Fix from NetBSD: flush caches on trap 2 in SunOS emulation. Comment on
authorbriggs <briggs@openbsd.org>
Tue, 8 Apr 1997 05:14:52 +0000 (05:14 +0000)
committerbriggs <briggs@openbsd.org>
Tue, 8 Apr 1997 05:14:52 +0000 (05:14 +0000)
mac68k change by scottr attributes Gordon (Ross) on the change.

sys/arch/atari/atari/trap.c
sys/arch/mvme68k/mvme68k/trap.c

index 7d6858d..9055e0a 100644 (file)
@@ -615,15 +615,16 @@ trap(type, code, v, frame)
        case T_TRAP15|T_USER:
 #ifdef COMPAT_SUNOS
                /*
-                * XXX This comment/code is not consistent XXX
-                * SunOS seems to use Trap #2 for some obscure 
-                * fpu operations.  So far, just ignore it, but
-                * DONT trap on it.. 
+                * SunOS uses Trap #2 for a "CPU cache flush"
+                * Just flush the on-chip caches and return.
+                * XXX - Too bad OpenBSD uses trap 2...
                 */
                if (p->p_emul == &emul_sunos) {
+                       ICIA();
+                       DCIU();
+                       /* get out fast */
                        userret(p, frame.f_pc, sticks); 
                        return;
-               }
 #endif
                frame.f_sr &= ~PSL_T;
                i = SIGTRAP;
index 9a4ed40..7dfa8b2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: trap.c,v 1.16 1997/03/31 00:24:16 downsj Exp $ */
+/*     $OpenBSD: trap.c,v 1.17 1997/04/08 05:14:52 briggs Exp $ */
 
 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -475,12 +475,14 @@ copyfault:
        case T_TRAP15|T_USER:   /* SUN user trace trap */
 #ifdef COMPAT_SUNOS
                /*
-                * XXX This comment/code is not consistent XXX
-                * SunOS seems to use Trap #2 for some obscure
-                * fpu operations.  So far, just ignore it, but
-                * DONT trap on it..
+                * SunOS uses Trap #2 for a "CPU cache flush"
+                * Just flush the on-chip caches and return.
+                * XXX - Too bad OpenBSD uses trap 2...
                 */
                if (p->p_emul == &emul_sunos) {
+                       ICIA();
+                       DCIU();
+                       /* get out fast */
                        userret(p, &frame, sticks, v, 1);
                        return;
                }