/* SPDX-License-Identifier: GPL-2.0-only */ #ifndef _COMMON_H_ #define _COMMON_H_ #define KSTACK_SIZE 0x4000 #include #include #include #include #include #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 DRIVER_ENTRY(fn) static void (*__initcall_##fn)(void) __attribute((used, section(".initcall"))) = fn #define DRIVER_ENTRY_PRIORITY(fn, pr) static void (*__initcall_##fn)(void) __attribute((used, section(".initcall." #pr))) = fn void yield(); void _panic(); extern bool kernel_init_ready; #endif /* _COMMON_H_ */