Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_bus.c
Show First 20 Lines • Show All 5,448 Lines • ▼ Show 20 Lines | |||||
* hw.bus.devices Reads the entire device tree in flat space. | * hw.bus.devices Reads the entire device tree in flat space. | ||||
* hw.bus.rman Resource manager interface | * hw.bus.rman Resource manager interface | ||||
* | * | ||||
* We might like to add the ability to scan devclasses and/or drivers to | * We might like to add the ability to scan devclasses and/or drivers to | ||||
* determine what else is currently loaded/available. | * determine what else is currently loaded/available. | ||||
*/ | */ | ||||
static int | static int | ||||
sysctl_bus(SYSCTL_HANDLER_ARGS) | sysctl_bus_info(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct u_businfo ubus; | struct u_businfo ubus; | ||||
ubus.ub_version = BUS_USER_VERSION; | ubus.ub_version = BUS_USER_VERSION; | ||||
ubus.ub_generation = bus_data_generation; | ubus.ub_generation = bus_data_generation; | ||||
return (SYSCTL_OUT(req, &ubus, sizeof(ubus))); | return (SYSCTL_OUT(req, &ubus, sizeof(ubus))); | ||||
} | } | ||||
SYSCTL_NODE(_hw_bus, OID_AUTO, info, CTLFLAG_RW | CTLFLAG_NEEDGIANT, sysctl_bus, | SYSCTL_PROC(_hw_bus, OID_AUTO, info, CTLTYPE_STRUCT | CTLFLAG_RD | | ||||
CTLFLAG_MPSAFE, NULL, 0, sysctl_bus_info, "S,u_businfo", | |||||
"bus-related data"); | "bus-related data"); | ||||
static int | static int | ||||
sysctl_devices(SYSCTL_HANDLER_ARGS) | sysctl_devices(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
int *name = (int *)arg1; | int *name = (int *)arg1; | ||||
u_int namelen = arg2; | u_int namelen = arg2; | ||||
int index; | int index; | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | bus_data_generation_check(int generation) | ||||
/* XXX generate optimised lists here? */ | /* XXX generate optimised lists here? */ | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
bus_data_generation_update(void) | bus_data_generation_update(void) | ||||
{ | { | ||||
bus_data_generation++; | |||||
atomic_add_int(&bus_data_generation, 1); | |||||
} | } | ||||
int | int | ||||
bus_free_resource(device_t dev, int type, struct resource *r) | bus_free_resource(device_t dev, int type, struct resource *r) | ||||
{ | { | ||||
if (r == NULL) | if (r == NULL) | ||||
return (0); | return (0); | ||||
return (bus_release_resource(dev, type, rman_get_rid(r), r)); | return (bus_release_resource(dev, type, rman_get_rid(r), r)); | ||||
▲ Show 20 Lines • Show All 462 Lines • Show Last 20 Lines |