| 5160 | devclass_t root_devclass; |
| 5161 | |
| 5162 | static int |
| 5163 | root_bus_module_handler(module_t mod, int what, void* arg) |
| 5164 | { |
| 5165 | switch (what) { |
| 5166 | case MOD_LOAD: |
| 5167 | TAILQ_INIT(&bus_data_devices); |
| 5168 | kobj_class_compile((kobj_class_t) &root_driver); |
| 5169 | root_bus = make_device(NULL, "root", 0); |
| 5170 | root_bus->desc = "System root bus"; |
| 5171 | kobj_init((kobj_t) root_bus, (kobj_class_t) &root_driver); |
| 5172 | root_bus->driver = &root_driver; |
| 5173 | root_bus->state = DS_ATTACHED; |
| 5174 | root_devclass = devclass_find_internal("root", NULL, FALSE); |
| 5175 | devinit(); |
| 5176 | return (0); |
| 5177 | |
| 5178 | case MOD_SHUTDOWN: |
| 5179 | device_shutdown(root_bus); |
| 5180 | return (0); |
| 5181 | default: |
| 5182 | return (EOPNOTSUPP); |
| 5183 | } |
| 5184 | |
| 5185 | return (0); |
| 5186 | } |
| 5187 | |
| 5188 | static moduledata_t root_bus_mod = { |
| 5189 | "rootbus", |
nothing calls this directly
no test coverage detected