feat: cleanup init code, small other refactors
This commit is contained in:
@@ -10,9 +10,12 @@ extern struct init __stop_init[];
|
||||
#define NUM_DRIVERS ((size_t)(__stop_init - __start_init))
|
||||
#define DRIVER(i) ((__start_init) + (i))
|
||||
|
||||
void init_execute_all() {
|
||||
void init_execute_all(enum init_stage stage) {
|
||||
for (size_t i = 0; i < NUM_DRIVERS; ++i) {
|
||||
printf("init %s\n", DRIVER(i)->name);
|
||||
if (DRIVER(i)->stage != stage) continue;
|
||||
if (stage > INIT_STAGE_EARLY_BOOT_0) {
|
||||
printf("init %s\n", DRIVER(i)->name);
|
||||
}
|
||||
DRIVER(i)->init();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user