summaryrefslogtreecommitdiffstats
path: root/klib/kpanic.c
blob: 2918711de229086b602b2d5293ef991ee481e9ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "jove.h"
#include "print.h"

#include <stdarg.h>
#include <stddef.h>

__attribute__((noreturn))
void _kpanic(const char *file, int line, const char *fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
    klogf("!!! PANIC !!!\n%s:%i\n", file, line);
    _plogvf(NULL, NULL, 0, PRINT_LOG, fmt, ap);
    va_end(ap);
    for(;;) __asm__ volatile("hlt");
}