Luna/kernel/include/panic/Panic.h

17 lines
547 B
C
Raw Normal View History

2022-09-25 14:56:00 +00:00
#pragma once
#include "interrupts/Context.h"
#ifdef __cplusplus
extern "C"
{
#endif
[[noreturn]] void __do_int_panic(Context* context, const char* file, int line, const char* message);
[[noreturn]] void __do_panic(Context* context, const char* message);
[[noreturn]] void __panic(const char* message);
#ifdef __cplusplus
}
#endif
#define panic(message) asm volatile("cli\npush $16\npushq %%rsp\npushfq\npush $8\ncall __panic" : : "D"(message))
#define int_panic(context, message) __do_int_panic(context, __FILE__, __LINE__, message)