kern/kernel/panic.c
fef 5a5135f416
update license terms
As of now, everything except the code imported
from FreeBSD is proprietary.  Of course, it won't
be like this for long, only until we have decided
which license we like to use.  The rationale is
that releasing everything under a copyleft license
later is always easier than doing so immediately
and then changing it afterwards.
Naturally, any changes made before this commit are
still subject to the terms of the CNPL.
2021-11-15 19:23:22 +01:00

32 lines
541 B
C

/* Copyright (C) 2021 fef <owo@fef.moe>. All rights reserved. */
#include <arch/cpufunc.h>
#include <gay/cdefs.h>
#include <gay/config.h>
#include <gay/kprintf.h>
#include <stdarg.h>
__noreturn
void panic(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
disable_intr();
kprintf("Kernel panic: ");
if (fmt == nil)
kprintf("(nil)\n");
else
kvprintf(fmt, args);
kprintf("\nKernel version: %s\nSystem halted", GAY_VERSION_STR);
/* no need for va_end() here i guess */
while (1) {
halt();
disable_intr();
}
}