voron

experimental ARM OS
git clone git://git.2f30.org/voron
Log | Files | Refs | README | LICENSE

commit e50c1e28650f983df0cb19b58918b4973f2edaa0
parent 549af230590c98b3d5f925a76a45db8d81b4eeba
Author: sin <sin@2f30.org>
Date:   Tue, 16 Jul 2013 22:31:15 +0100

Add panic()

Diffstat:
Minclude/kernel.h | 1+
Ainclude/panic.h | 6++++++
Akernel/panic.c | 14++++++++++++++
3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/include/kernel.h b/include/kernel.h @@ -12,6 +12,7 @@ #include <alloc.h> #include <debug.h> #include <atomic.h> +#include <panic.h> #define __unused __attribute__((__unused__)) diff --git a/include/panic.h b/include/panic.h @@ -0,0 +1,6 @@ +#ifndef __PANIC_H +#define __PANIC_H + +void panic(const char *fmt, ...); + +#endif /* __PANIC_H */ diff --git a/kernel/panic.c b/kernel/panic.c @@ -0,0 +1,14 @@ +#include <kernel.h> + +void +panic(const char *fmt, ...) +{ + va_list ap; + + /* TODO: Shut down interrupts */ + kprintf("~~~ kernel panic ~~~\n"); + va_start(ap, fmt); + kvprintf(fmt, ap); + va_end(ap); + for (;;); +}