summaryrefslogtreecommitdiff
path: root/src/kernel/panic.h
blob: 7d2ea5fcf5334c52ad8361de75c117ac3ea8d2e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once
#include <kernel/tty.h>
#include <platform/asm.h>

// dumb c shit
#define panic_tostr2(x) #x
#define panic_tostr(x)  panic_tostr2(x)

#define panic() do { \
	tty_const(" PANIC! at the "); \
	tty_const(__func__); \
	tty_const(" (" __FILE__ ":" panic_tostr(__LINE__) ") "); \
	halt_cpu(); \
} while (0)