v2 initial commit
This commit is contained in:
parent
2c97dba9f7
commit
d2ef885e8d
118 changed files with 2420 additions and 9320 deletions
|
|
@ -6,43 +6,27 @@
|
|||
|
||||
#include <limine/limine.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <lib/stdio.h>
|
||||
#include <lib/string.h>
|
||||
#include <lib/errno.h>
|
||||
#include <lib/math.h>
|
||||
#include <lib/assert.h>
|
||||
#include <kernel/types.h>
|
||||
|
||||
#include <kernel/bitwise.h>
|
||||
#include <lib/stdio.h>
|
||||
|
||||
#define PACKED __attribute__((packed))
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
#define ATTEMPT_WRITE(_x, _y) \
|
||||
if (_x) { \
|
||||
*(_x) = _y; \
|
||||
*(_x) = _y; \
|
||||
}
|
||||
|
||||
#define KB (1024ull)
|
||||
#define MB (KB * KB)
|
||||
#define GB (KB * MB)
|
||||
|
||||
#define RFLAGS_IF (1 << 9)
|
||||
|
||||
void yield();
|
||||
void panic();
|
||||
void cli();
|
||||
void sti();
|
||||
void _save_context();
|
||||
void reboot();
|
||||
void load_stack_and_jump(uintptr_t rsp, uintptr_t rbp, void *func, void *arg);
|
||||
#define panic(...) \
|
||||
{ \
|
||||
kprintf(LOG_PANIC __VA_ARGS__); \
|
||||
_panic(); \
|
||||
}
|
||||
|
||||
typedef uintptr_t paddr_t;
|
||||
typedef uint32_t paddr32_t;
|
||||
typedef int64_t ssize_t;
|
||||
typedef int mode_t;
|
||||
typedef long dev_t;
|
||||
void yield();
|
||||
void _panic();
|
||||
|
||||
#endif /* _COMMON_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue