must insure bus errors and ksp not valid signals are handled
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Wed, 8 Jan 1986 15:15:53 +0000 (07:15 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Wed, 8 Jan 1986 15:15:53 +0000 (07:15 -0800)
on the kernel stack (rather than the interrupt stack); do this by posting
an ast and reentering the kernel to service the posted signal on the kernel stack

SCCS-vsn: sys/tahoe/tahoe/trap.c 1.3

usr/src/sys/tahoe/tahoe/trap.c

index 3f75f98..3a9e58d 100644 (file)
@@ -1,4 +1,4 @@
-/*     trap.c  1.2     86/01/05        */
+/*     trap.c  1.3     86/01/07        */
 
 #include "../tahoe/psl.h"
 #include "../tahoe/reg.h"
 
 #include "../tahoe/psl.h"
 #include "../tahoe/reg.h"
@@ -133,17 +133,29 @@ trap(sp, type, hfs, accmst, acclst, dbl, code, pc, psl)
                i = SIGTRAP;
                break;
 
                i = SIGTRAP;
                break;
 
+       /*
+        * For T_KSPNOTVAL and T_BUSERR, can not allow spl to
+        * drop to 0 as clock could go off and we would end up
+        * doing an rei to the interrupt stack at ipl 0 (a
+        * reserved operand fault).  Instead, we allow psignal
+        * to post an ast, then return to user mode where we
+        * will reenter the kernel on the kernel's stack and
+        * can then service the signal.
+        */
        case T_KSPNOTVAL:
        case T_KSPNOTVAL:
+               if (noproc)
+                       panic("ksp not valid");
+               /* fall thru... */
        case T_KSPNOTVAL + USER:
        case T_KSPNOTVAL + USER:
-               i = SIGKILL;    /* There is nothing to do but to kill the 
-                                * process.. */
-               printf("KSP NOT VALID.\n");
-               break;
+               printf("pid %d: ksp not valid\n", u.u._procp->p_pid);
+               /* must insure valid kernel stack pointer? */
+               psignal(u.u_procp, SIGKILL);
+               return;
 
        case T_BUSERR + USER:
 
        case T_BUSERR + USER:
-               i = SIGBUS;
                u.u_code = code;
                u.u_code = code;
-               break;
+               psignal(u.u_procp, SIGBUS);
+               return;
        }
        psignal(u.u_procp, i);
 out:
        }
        psignal(u.u_procp, i);
 out: