summaryrefslogtreecommitdiff
path: root/src/kernel/panic.h
blob: 54a0b8b8199599ea3a65882358a09f6974cc1960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once
#include <arch/generic.h>
#include <arch/i386/tty.h> // TODO abstract away

// 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)