summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-03 17:54:29 -0400
committerIan Moffett <ian@osmora.org>2025-07-03 17:54:29 -0400
commita9965cb3292782f2072141c12d609de0871d1c7c (patch)
treefc4d1297cecfe578f15eeb3be17d2076030a0eec /sys/include
parent8378d14cc0f4996080e21c84491ba9b8fcb679a4 (diff)
kernel: driver: Implement driver blacklist
Sometimes one may not want *all* of the drivers to start up during system boot. The driver blacklist allows one to mark a driver to be ignored during startup. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/driver.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/include/sys/driver.h b/sys/include/sys/driver.h
index a7cb2ae..e10021a 100644
--- a/sys/include/sys/driver.h
+++ b/sys/include/sys/driver.h
@@ -104,12 +104,20 @@ extern char __driversd_init_end[];
for (struct driver *__d = (struct driver *)__drivers_init_start; \
(uintptr_t)__d < (uintptr_t)__drivers_init_end; ++__d) \
{ \
+ if (driver_blacklist_check((__d)->name)) { \
+ continue; \
+ } \
__d->init(); \
}
#define DRIVERS_SCHED() \
spawn(&g_proc0, __driver_init_td, NULL, 0, NULL)
+/* Driver blacklist framework */
+int driver_blacklist(const char *name);
+int driver_blacklist_check(const char *name);
+void driver_blacklist_init(void);
+
void __driver_init_td(void);
#endif /* _KERNEL */