31 lines
741 B
C
31 lines
741 B
C
//
|
|
// Created by rick on 13-08-21.
|
|
//
|
|
|
|
#ifndef NEW_KERNEL_INIT_H
|
|
#define NEW_KERNEL_INIT_H
|
|
|
|
#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(enum init_stage stage);
|
|
|
|
#endif //NEW_KERNEL_INIT_H
|