summaryrefslogtreecommitdiff
path: root/src/kernel/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/panic.c')
-rw-r--r--src/kernel/panic.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/kernel/panic.c b/src/kernel/panic.c
index a2e68e3..5d32bf7 100644
--- a/src/kernel/panic.c
+++ b/src/kernel/panic.c
@@ -1,11 +1,17 @@
-#include "panic.h"
#include "log.h"
#include "vga.h"
+#include "util.h"
-void panic(const char *message) {
+__attribute__ ((noreturn))
+void panic(const char *filename, uint32_t line, const char *message) {
set_log_mode(LOG_PANIC);
vga_blank();
- logsz("Kernel panic: ");
+ logsz("Kernel panic [");
+ logsz(filename);
+ char nbuf[12] = ":";
+ u32_dec(line, nbuf + 1);
+ logsz(nbuf);
+ logsz("]: ");
logsz(message);
logsz("\nHalting.");
while (1)