BSD 4_3_Tahoe release
[unix-history] / usr / src / sys / vax / trap.c
index 69761ab..341c738 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)trap.c      7.1 (Berkeley) 6/5/86
+ *     @(#)trap.c      7.3 (Berkeley) 5/19/88
  */
 
 #include "psl.h"
  */
 
 #include "psl.h"
@@ -44,12 +44,11 @@ char        *trap_type[] = {
        "Protection fault",
        "Trace trap",
        "Compatibility mode trap",
        "Protection fault",
        "Trace trap",
        "Compatibility mode trap",
-#ifdef notdef
        "Page fault",
        "Page table fault",
        "Page fault",
        "Page table fault",
-#endif
+       "Kernel debugger trap",
 };
 };
-#define        TRAP_TYPES      (sizeof trap_type / sizeof trap_type[0])
+int    TRAP_TYPES = (sizeof trap_type / sizeof trap_type[0]);
 
 /*
  * Called from the trap handler when a processor trap occurs.
 
 /*
  * Called from the trap handler when a processor trap occurs.
@@ -73,6 +72,10 @@ trap(sp, type, code, pc, psl)
        switch (type) {
 
        default:
        switch (type) {
 
        default:
+#ifdef KADB
+               if (kdb_trap(&psl))
+                       return;
+#endif
                printf("trap type %d, code = %x, pc = %x\n", type, code, pc);
                type &= ~USER;
                if ((unsigned)type < TRAP_TYPES)
                printf("trap type %d, code = %x, pc = %x\n", type, code, pc);
                type &= ~USER;
                if ((unsigned)type < TRAP_TYPES)