Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103814496
D14750.id41081.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14750.id41081.diff
View Options
Index: head/sys/dev/ofw/ofw_bus_subr.h
===================================================================
--- head/sys/dev/ofw/ofw_bus_subr.h
+++ head/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: head/sys/dev/ofw/ofw_bus_subr.c
===================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c
+++ head/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 **)®);
+ ret = OF_getencprop_alloc(node, reg_source, sizeof(*reg), (void **)®);
nreg = (ret == -1) ? 0 : ret;
if (nreg % (acells + scells) != 0) {
@@ -535,6 +535,23 @@
free(reg, M_OFWPROP);
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"));
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 7:18 PM (18 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14948980
Default Alt Text
D14750.id41081.diff (1 KB)
Attached To
Mode
D14750: Add api for create resource list based on 'assigned-addresses'
Attached
Detach File
Event Timeline
Log In to Comment