From a9965cb3292782f2072141c12d609de0871d1c7c Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 3 Jul 2025 17:54:29 -0400 Subject: 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 --- sys/include/sys/driver.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/include') 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 */ -- cgit v1.2.3