diff options
Diffstat (limited to 'sys/arch/mvme88k/stand/libsa/panic.c')
-rw-r--r-- | sys/arch/mvme88k/stand/libsa/panic.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/arch/mvme88k/stand/libsa/panic.c b/sys/arch/mvme88k/stand/libsa/panic.c new file mode 100644 index 00000000000..f7c83a6d8e7 --- /dev/null +++ b/sys/arch/mvme88k/stand/libsa/panic.c @@ -0,0 +1,31 @@ + +#include <stdarg.h> +#include "stand.h" + +extern volatile void abort(); +extern int _estack[]; + +__dead void +panic(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + printf(fmt, ap); + printf("\n"); + va_end(ap); + stackdump(0); + abort(); +} + +stackdump(dummy) + int dummy; +{ + int *ip; + + printf("stackdump:\n"); + for (ip = &dummy; ip < _estack; ip += 4) { + printf("%x: %x %x %x %x\n", + (int)ip, ip[0], ip[1], ip[2], ip[3]); + } +} |