Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm26/arm26 Don't panic on a segfault, but drop int...



details:   https://anonhg.NetBSD.org/src/rev/aa0252c4972b
branches:  trunk
changeset: 486179:aa0252c4972b
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Sun May 14 22:50:01 2000 +0000

description:
Don't panic on a segfault, but drop into the debugger if it's there.
Not that this helps much, since we immediately panic in cpu_coredump instead.

diffstat:

 sys/arch/arm26/arm26/except.c |  38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diffs (90 lines):

diff -r c1d89e255f08 -r aa0252c4972b sys/arch/arm26/arm26/except.c
--- a/sys/arch/arm26/arm26/except.c     Sun May 14 22:44:21 2000 +0000
+++ b/sys/arch/arm26/arm26/except.c     Sun May 14 22:50:01 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: except.c,v 1.1 2000/05/09 21:55:56 bjh21 Exp $ */
+/* $NetBSD: except.c,v 1.2 2000/05/14 22:50:01 bjh21 Exp $ */
 /*-
  * Copyright (c) 1998, 1999, 2000 Ben Harris
  * All rights reserved.
@@ -32,7 +32,11 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.1 2000/05/09 21:55:56 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.2 2000/05/14 22:50:01 bjh21 Exp $");
+
+#include "opt_cputypes.h"
+#include "opt_ddb.h"
+#include "opt_ktrace.h"
 
 #include <sys/syscall.h>
 #include <sys/syslog.h>
@@ -50,10 +54,6 @@
 #include <arm32/arm32/disassem.h>
 #endif
 
-#include "opt_cputypes.h"
-#include "opt_ddb.h"
-#include "opt_ktrace.h"
-
 #ifdef DDB
 #include <machine/db_machdep.h>
 #endif
@@ -363,8 +363,11 @@
                printf("unhandled fault at %p (ret = %d)\n", (void *)pc, ret);
                printf("Prefetch abort:\n");
                printregs(tf);
+#ifdef DDB
+               Debugger();
 #endif
-               panic("prefetch_abort_handler: uvm_fault failed");
+#endif
+               trapsignal(p, SIGSEGV, pc);
        }
 out:
        userret(p, pc, sticks);
@@ -428,8 +431,11 @@
                printregs(tf);
                printf("pc -> ");
                disassemble(tf->tf_r15 & R15_PC);
+#ifdef DDB
+               Debugger();
 #endif
-               panic("data_abort_handler: uvm_fault failed");
+#endif
+               trapsignal(p, SIGSEGV, va);
        }
 
 out:
@@ -632,17 +638,27 @@
        if ((tf->tf_r15 & R15_MODE) == R15_MODE_USR)
                p->p_addr->u_pcb.pcb_tf = tf;
        
-/*     if ((tf->tf_r15 & R15_MODE) != R15_MODE_USR) */{
+       pc = tf->tf_r15 & R15_PC;
+
+       if ((tf->tf_r15 & R15_MODE) != R15_MODE_USR) {
 #ifdef DEBUG
                printf("Address exception:\n");
                printregs(tf);
                printf("pc -> ");
-               disassemble(tf->tf_r15 & R15_PC);
+               disassemble(pc);
 #endif
                panic("address exception in kernel mode");
        }
 
-       pc = tf->tf_r15 & R15_PC;
+#ifdef DEBUG
+       printf("Address exception:\n");
+       printregs(tf);
+       printf("pc -> ");
+       disassemble(pc);
+#ifdef DDB
+       Debugger();
+#endif
+#endif
        sticks = p->p_sticks;
        trapsignal(p, SIGBUS, pc);
        userret(p, pc, sticks);



Home | Main Index | Thread Index | Old Index