Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148645800
D37031.1787865826.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D37031.1787865826.diff
View Options
diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c
--- a/sys/arm/arm/gic_fdt.c
+++ b/sys/arm/arm/gic_fdt.c
@@ -90,6 +90,7 @@
/* Bus interface */
DEVMETHOD(bus_get_resource_list,gic_fdt_get_resource_list),
+ DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path),
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo, gic_ofw_get_devinfo),
diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c
--- a/sys/arm64/arm64/gic_v3_fdt.c
+++ b/sys/arm64/arm64/gic_v3_fdt.c
@@ -64,6 +64,7 @@
/* Bus interface */
DEVMETHOD(bus_get_resource_list, gic_v3_fdt_get_resource_list),
+ DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path),
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo, gic_v3_ofw_get_devinfo),
diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c
--- a/sys/dev/fdt/simplebus.c
+++ b/sys/dev/fdt/simplebus.c
@@ -94,6 +94,7 @@
DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo),
DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list),
DEVMETHOD(bus_get_property, simplebus_get_property),
+ DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path),
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo, simplebus_get_devinfo),
diff --git a/sys/dev/ofw/ofw_bus_subr.h b/sys/dev/ofw/ofw_bus_subr.h
--- a/sys/dev/ofw/ofw_bus_subr.h
+++ b/sys/dev/ofw/ofw_bus_subr.h
@@ -84,6 +84,7 @@
/* Helper method to report interesting OF properties in pnpinfo */
bus_child_pnpinfo_t ofw_bus_gen_child_pnpinfo;
+bus_get_device_path_t ofw_bus_gen_get_device_path;
/* Routines for processing firmware interrupt maps */
void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int);
diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -104,6 +104,22 @@
return (0);
};
+int
+ofw_bus_gen_get_device_path(device_t cbdev, device_t child, const char *locator,
+ struct sbuf *sb)
+{
+ int rv;
+
+ if ( strcmp(locator, BUS_LOCATOR_OFW) == 0){
+ rv = bus_generic_get_device_path(cbdev, child, locator, sb);
+ if (rv == 0){
+ sbuf_printf(sb, "/%s", ofw_bus_get_name(child));
+ }
+ return (rv);
+ }
+ return (bus_generic_get_device_path(cbdev, child, locator, sb));
+};
+
const char *
ofw_bus_gen_get_compat(device_t bus, device_t dev)
{
diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c
--- a/sys/dev/ofw/ofw_cpu.c
+++ b/sys/dev/ofw/ofw_cpu.c
@@ -68,6 +68,7 @@
/* Bus interface */
DEVMETHOD(bus_add_child, bus_generic_add_child),
DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo),
+ DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path),
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo, ofw_cpulist_get_devinfo),
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -761,6 +761,7 @@
#define BUS_LOCATOR_ACPI "ACPI"
#define BUS_LOCATOR_FREEBSD "FreeBSD"
#define BUS_LOCATOR_UEFI "UEFI"
+#define BUS_LOCATOR_OFW "OFW"
extern int bus_current_pass;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 27, 9:23 PM (19 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29474964
Default Alt Text
D37031.1787865826.diff (2 KB)
Attached To
Mode
D37031: ofw: add BUS_GET_DEVICE_PATH interface to openfirm/fdt, somewhat incomplete.
Attached
Detach File
Event Timeline
Log In to Comment