Page MenuHomeFreeBSD

D14750.id40463.diff
No OneTemporary

D14750.id40463.diff

Index: sys/dev/ofw/ofw_bus_subr.h
===================================================================
--- sys/dev/ofw/ofw_bus_subr.h
+++ sys/dev/ofw/ofw_bus_subr.h
@@ -95,6 +95,8 @@
/* Routines for parsing device-tree data into resource lists. */
int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t,
struct resource_list *);
+int ofw_bus_assigned_addresses_to_rl(device_t, phandle_t, pcell_t, pcell_t,
+ struct resource_list *);
int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *, int *);
int ofw_bus_intr_by_rid(device_t, phandle_t, int, phandle_t *, int *,
pcell_t **);
Index: sys/dev/ofw/ofw_bus_subr.c
===================================================================
--- sys/dev/ofw/ofw_bus_subr.c
+++ sys/dev/ofw/ofw_bus_subr.c
@@ -489,9 +489,9 @@
return (err);
}
-int
-ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells,
- struct resource_list *rl)
+static int
+ofw_bus_reg_to_rl_helper(device_t dev, phandle_t node, pcell_t acells, pcell_t scells,
+ struct resource_list *rl, const char *reg_source)
{
uint64_t phys, size;
ssize_t i, j, rid, nreg, ret;
@@ -506,7 +506,7 @@
if (ret == -1)
name = NULL;
- ret = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)&reg);
+ ret = OF_getencprop_alloc(node, reg_source, sizeof(*reg), (void **)&reg);
nreg = (ret == -1) ? 0 : ret;
if (nreg % (acells + scells) != 0) {
@@ -537,6 +537,23 @@
return (0);
}
+int
+ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells,
+ struct resource_list *rl)
+{
+
+ return (ofw_bus_reg_to_rl_helper(dev, node, acells, scells, rl, "reg"));
+}
+
+int
+ofw_bus_assigned_addresses_to_rl(device_t dev, phandle_t node, pcell_t acells,
+ pcell_t scells, struct resource_list *rl)
+{
+
+ return (ofw_bus_reg_to_rl_helper(dev, node, acells, scells,
+ rl, "assigned-addresses"));
+}
+
/*
* Get interrupt parent for given node.
* Returns 0 if interrupt parent doesn't exist.

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 7:44 PM (19 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14949243
Default Alt Text
D14750.id40463.diff (1 KB)

Event Timeline