summaryrefslogtreecommitdiff
path: root/kernel/lib/panic.c
blob: 486f4b5a7456ff9a91bba94a7b7643d59d104438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "lib/klib.h"
#include <lib.h>
#include <stdarg.h>
#include <comus/asm.h>

__attribute__((noreturn)) void __panic(const char *line, const char *file, const char *format, ...)
{
	cli();
	va_list list;
	va_start(list, format);
	kprintf("\n\n!!! PANIC !!!\n");
	kprintf("In file %s at line %s:\n", file, line);
	kvprintf(format, list);
	kprintf("\n\n");
	log_backtrace();

	while (1)
		halt();
}