banan-os/kernel/include/kernel/panic.h

19 lines
320 B
C
Raw Normal View History

2022-11-14 18:53:00 +02:00
#pragma once
#include <kernel/kprint.h>
2022-11-14 18:53:00 +02:00
namespace Kernel
{
template<typename... Args>
2022-11-14 18:53:00 +02:00
__attribute__((__noreturn__))
static void panic(const char* message, Args... args)
{
kprint("\e[31mKernel panic: ");
kprint(message, args...);
kprint("\e[m\n");
2022-12-03 18:19:07 +02:00
asm volatile("cli; hlt");
__builtin_unreachable();
}
2022-11-14 18:53:00 +02:00
}