feat: cleanup init code, small other refactors
This commit is contained in:
@@ -8,13 +8,23 @@
|
||||
#include <sys/types.h>
|
||||
#include <myke/driver.h>
|
||||
|
||||
enum init_stage {
|
||||
INIT_STAGE_EARLY_BOOT_0, // id mapped, high memory, no malloc
|
||||
INIT_STAGE_EARLY_BOOT_1, // memory available, no tasking
|
||||
INIT_STAGE_LATE_BOOT, // time source, memory, most basic hardware available
|
||||
INIT_STAGE_PRE_TASKING, // just before tasking is ready
|
||||
INIT_STAGE_AFTER_BOOT_PRE_INIT, // tasking just started
|
||||
// todo define later stages
|
||||
};
|
||||
|
||||
struct init {
|
||||
const char *name;
|
||||
enum init_stage stage;
|
||||
void (*init)();
|
||||
};
|
||||
|
||||
#define INIT_FUNCTION(order) GENERIC_DRIVER(init, order)
|
||||
|
||||
void init_execute_all();
|
||||
void init_execute_all(enum init_stage stage);
|
||||
|
||||
#endif //NEW_KERNEL_INIT_H
|
||||
|
||||
Reference in New Issue
Block a user