2023-12-03 17:08:00 +08:00
|
|
|
#ifndef KERNEL_H
|
|
|
|
#define KERNEL_H 1
|
|
|
|
|
|
|
|
#include <types.h>
|
2023-12-13 02:24:25 +08:00
|
|
|
|
|
|
|
#ifdef __x86_64__
|
|
|
|
|
|
|
|
#include <kernel/arch/x86_64/kernel.h>
|
|
|
|
|
2024-01-14 21:52:10 +08:00
|
|
|
#define ISA_NAME "x86_64"
|
2023-12-13 02:24:25 +08:00
|
|
|
|
|
|
|
#endif
|
2023-12-03 17:08:00 +08:00
|
|
|
|
|
|
|
#define KERNEL_TODO() \
|
|
|
|
while (true) \
|
|
|
|
{ \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define simple_lock_lock(lock) \
|
|
|
|
{ \
|
|
|
|
while (lock == true) \
|
|
|
|
; \
|
|
|
|
(lock) = true; \
|
|
|
|
}
|
|
|
|
#define simple_lock_unlock(lock) (lock) = false;
|
|
|
|
|
2024-01-20 23:50:03 +08:00
|
|
|
extern void kmain_rust();
|
|
|
|
|
2023-12-03 17:08:00 +08:00
|
|
|
extern void *kend; // 内核结束的标记
|
|
|
|
|
|
|
|
#endif
|