38 lines
742 B
C
38 lines
742 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef _COMMON_H_
|
|
#define _COMMON_H_
|
|
|
|
#define KSTACK_SIZE 0x4000
|
|
|
|
#include <limine/limine.h>
|
|
|
|
#include <kernel/types.h>
|
|
|
|
#include <lib/stdio.h>
|
|
#include <lib/math.h>
|
|
#include <lib/errno.h>
|
|
|
|
#define PACKED __attribute__((packed))
|
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
|
|
|
#define ATTEMPT_WRITE(_x, _y) \
|
|
if (_x) { \
|
|
*(_x) = _y; \
|
|
}
|
|
|
|
#define RFLAGS_IF (1 << 9)
|
|
|
|
#define panic(...) \
|
|
{ \
|
|
kprintf(LOG_PANIC __VA_ARGS__); \
|
|
_panic(); \
|
|
}
|
|
|
|
#define CLEANUP(fn) __attribute__((__cleanup__(fn)))
|
|
|
|
void yield();
|
|
void _panic();
|
|
|
|
extern bool kernel_init_ready;
|
|
|
|
#endif /* _COMMON_H_ */
|