toaruos/kernel/core/panic.c

20 lines
542 B
C
Raw Normal View History

2011-01-21 04:49:35 +03:00
#include <system.h>
void halt_and_catch_fire(char * error_message, const char * file, int line) {
__asm__ __volatile__("cli");
settextcolor(14,4);
kprintf("PANIC! %s\n", error_message);
kprintf("File: %s\n", file);
kprintf("Line: %d\n", line);
__asm__ __volatile__ ("hlt");
2011-01-21 04:49:35 +03:00
}
void assert_failed(const char *file, uint32_t line, const char *desc) {
__asm__ __volatile__("cli");
settextcolor(14,4);
kprintf("ASSERTION FAILED! %s\n", desc);
kprintf("File: %s\n", file);
kprintf("Line: %d\n", line);
__asm__ __volatile__ ("hlt");
2011-01-21 04:49:35 +03:00
}