Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/acorn26/acorn26 On a prefetch abort or an address e...



details:   https://anonhg.NetBSD.org/src/rev/008385039b5b
branches:  trunk
changeset: 555819:008385039b5b
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Sat Nov 29 22:03:21 2003 +0000

description:
On a prefetch abort or an address exception in the kernel, drop
straight into DDB rather than calling panic().  This will allow DDB to
see what was actually going on at the time of the exception.

diffstat:

 sys/arch/acorn26/acorn26/except.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (62 lines):

diff -r f9c59fe296c2 -r 008385039b5b sys/arch/acorn26/acorn26/except.c
--- a/sys/arch/acorn26/acorn26/except.c Sat Nov 29 20:30:27 2003 +0000
+++ b/sys/arch/acorn26/acorn26/except.c Sat Nov 29 22:03:21 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: except.c,v 1.5 2003/10/26 13:19:30 jdolecek Exp $ */
+/* $NetBSD: except.c,v 1.6 2003/11/29 22:03:21 bjh21 Exp $ */
 /*-
  * Copyright (c) 1998, 1999, 2000 Ben Harris
  * All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.5 2003/10/26 13:19:30 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.6 2003/11/29 22:03:21 bjh21 Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -55,6 +55,7 @@
 #endif
 
 #ifdef DDB
+#include <ddb/db_output.h>
 #include <machine/db_machdep.h>
 #endif
 
@@ -120,11 +121,16 @@
                l->l_addr->u_pcb.pcb_tf = tf;
 
        if ((tf->tf_r15 & R15_MODE) != R15_MODE_USR) {
+#ifdef DDB
+               db_printf("Prefetch abort in kernel mode\n");
+               kdb_trap(T_FAULT, tf);
+#else
 #ifdef DEBUG
                printf("Prefetch abort:\n");
                printregs(tf);
 #endif
                panic("prefetch abort in kernel mode");
+#endif
        }
 
        /* User-mode prefetch abort */
@@ -442,6 +448,10 @@
        pc = tf->tf_r15 & R15_PC;
 
        if ((tf->tf_r15 & R15_MODE) != R15_MODE_USR) {
+#ifdef DDB
+               db_printf("Address exception in kernel mode\n");
+               kdb_trap(T_FAULT, tf);
+#else
 #ifdef DEBUG
                printf("Address exception:\n");
                printregs(tf);
@@ -449,6 +459,7 @@
                disassemble(pc);
 #endif
                panic("address exception in kernel mode");
+#endif
        }
 
        KSI_INIT_TRAP(&ksi);



Home | Main Index | Thread Index | Old Index