Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135449008
D930.id1944.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
D930.id1944.diff
View Options
Index: sys/kern/subr_bus.c
===================================================================
--- sys/kern/subr_bus.c
+++ sys/kern/subr_bus.c
@@ -285,6 +285,7 @@
device_sysctl_init(device_t dev)
{
devclass_t dc = dev->devclass;
+ int domain;
if (dev->sysctl_tree != NULL)
return;
@@ -314,6 +315,10 @@
OID_AUTO, "%parent", CTLTYPE_STRING | CTLFLAG_RD,
dev, DEVICE_SYSCTL_PARENT, device_sysctl_handler, "A",
"parent device");
+ if (bus_get_domain(dev, &domain) == 0)
+ SYSCTL_ADD_INT(&dev->sysctl_ctx,
+ SYSCTL_CHILDREN(dev->sysctl_tree), OID_AUTO, "%domain",
+ CTLFLAG_RD, NULL, domain, "NUMA domain");
}
static void
@@ -4542,6 +4547,18 @@
return (BUS_GET_DMA_TAG(parent, dev));
}
+/**
+ * @brief Wrapper function for BUS_GET_RESOURCE().
+ *
+ * This function simply calls the BUS_GET_RESOURCE() method of the
+ * parent of @p dev.
+ */
+int
+bus_get_domain(device_t dev, int *domain)
+{
+ return (BUS_GET_DOMAIN(device_get_parent(dev), dev, domain));
+}
+
/* Resume all devices and then notify userland that we're up again. */
static int
root_resume(device_t dev)
Index: sys/sys/bus.h
===================================================================
--- sys/sys/bus.h
+++ sys/sys/bus.h
@@ -392,6 +392,7 @@
int bus_deactivate_resource(device_t dev, int type, int rid,
struct resource *r);
bus_dma_tag_t bus_get_dma_tag(device_t dev);
+int bus_get_domain(device_t dev, int *domain);
int bus_release_resource(device_t dev, int type, int rid,
struct resource *r);
int bus_free_resource(device_t dev, int type, struct resource *r);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 10, 11:25 PM (5 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25126337
Default Alt Text
D930.id1944.diff (1 KB)
Attached To
Mode
D930: Add a dev.foo.N.%domain sysctl and bus_get_domain() wrapper.
Attached
Detach File
Event Timeline
Log In to Comment