summaryrefslogtreecommitdiff
path: root/src/kernel/panic.h
blob: 12c0d6476f731115f06c20db20c488a2821346e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#pragma once
#include <assert.h>
#include <kernel/arch/generic.h>
#include <kernel/util.h>

#define _panic(type) do { \
	kprintf("\nan "type" PANIC! at the "); \
	kprintf(__func__); \
	kprintf(" (" __FILE__ ":" NUM2STR(__LINE__) ")\n"); \
	debug_stacktrace(); \
	cpu_halt(); \
} while (0)

#define panic_invalid_state() _panic("invalid state")
#define panic_unimplemented() _panic("unimplemented")