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);
|
2011-02-14 08:41:43 +03:00
|
|
|
__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);
|
2011-02-14 08:41:43 +03:00
|
|
|
__asm__ __volatile__ ("hlt");
|
2011-01-21 04:49:35 +03:00
|
|
|
}
|