Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/alpha Dispatch to the debugger from the Intru...



details:   https://anonhg.NetBSD.org/src/rev/fb8147952fe1
branches:  trunk
changeset: 472057:fb8147952fe1
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Apr 19 23:24:14 1999 +0000

description:
Dispatch to the debugger from the Intruction Fault trap vector directly,
rather than doing it from trap().  This so we can switch to a temporary
stack for the debugger (in a forthcoming commit).

diffstat:

 sys/arch/alpha/alpha/locore.s |  25 +++++++++++++++++++++++--
 sys/arch/alpha/alpha/trap.c   |  26 ++++----------------------
 2 files changed, 27 insertions(+), 24 deletions(-)

diffs (102 lines):

diff -r 527405f6587e -r fb8147952fe1 sys/arch/alpha/alpha/locore.s
--- a/sys/arch/alpha/alpha/locore.s     Mon Apr 19 23:22:19 1999 +0000
+++ b/sys/arch/alpha/alpha/locore.s     Mon Apr 19 23:24:14 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.60 1999/03/24 05:50:50 mrg Exp $ */
+/* $NetBSD: locore.s,v 1.61 1999/04/19 23:24:14 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -66,6 +66,7 @@
 
 .stabs __FILE__,100,0,0,kernel_text
 
+#include "opt_ddb.h"
 #include "opt_multiprocessor.h"
 #include "opt_compat_linux.h"
 
@@ -75,7 +76,7 @@
 
 #include <machine/asm.h>
 
-__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.60 1999/03/24 05:50:50 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.61 1999/04/19 23:24:14 thorpej Exp $");
 
 #ifndef EVCNT_COUNTERS
 #include <machine/intrcnt.h>
@@ -514,6 +515,26 @@
        /* a0, a1, & a2 already set up */
        ldiq    a3, ALPHA_KENTRY_IF
        mov     sp, a4                  ; .loc 1 __LINE__
+#if defined(DDB)
+       /*
+        * Kernel-mode BUGCHK and BPT traps enter the kernel debugger.
+        */
+       ldq     t0, (FRAME_PS*8)(sp)
+       and     t0, ALPHA_PSL_USERMODE, t0
+       bne     t0, Lcalltrap           /* usermode */
+
+       cmpeq   a0, ALPHA_IF_CODE_BPT, t0
+       bne     t0, Lcalldbgr           /* got BPT */
+
+       cmpeq   a0, ALPHA_IF_CODE_BUGCHK, t0
+       beq     t0, Lcalltrap           /* not BUGCHK */
+Lcalldbgr:
+       CALL(ddb_trap)
+       beq     v0, Lcalltrap           /* debugger didn't handle trap! */
+       
+       jmp     zero, exception_return  /* debugger handled it, return */
+Lcalltrap:
+#endif
        CALL(trap)
        jmp     zero, exception_return  
        END(XentIF)
diff -r 527405f6587e -r fb8147952fe1 sys/arch/alpha/alpha/trap.c
--- a/sys/arch/alpha/alpha/trap.c       Mon Apr 19 23:22:19 1999 +0000
+++ b/sys/arch/alpha/alpha/trap.c       Mon Apr 19 23:24:14 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.42 1999/03/24 05:50:51 mrg Exp $ */
+/* $NetBSD: trap.c,v 1.43 1999/04/19 23:24:14 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.42 1999/03/24 05:50:51 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.43 1999/04/19 23:24:14 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -282,28 +282,10 @@
        case ALPHA_KENTRY_IF:
                /*
                 * These are always fatal in kernel, and should never
-                * happen.
+                * happen.  (Debugger entry is handled in XentIF.)
                 */
-               if (!user) {
-#ifdef DDB
-                       /*
-                        * ...unless, of course, DDB is configured; BUGCHK
-                        * is used to invoke the kernel debugger, and we
-                        * might have set a breakpoint.
-                        */
-                       if (a0 == ALPHA_IF_CODE_BUGCHK ||
-                           a0 == ALPHA_IF_CODE_BPT) {
-                               if (ddb_trap(a0, a1, a2, entry, framep))
-                                       goto out;
-                       }
-
-                       /*
-                        * If we get here, DDB did _not_ handle the
-                        * trap, and we need to PANIC!
-                        */
-#endif
+               if (!user)
                        goto dopanic;
-               }
                i = 0;
                switch (a0) {
                case ALPHA_IF_CODE_GENTRAP:



Home | Main Index | Thread Index | Old Index