Correct handling for Trap #2 in SunOS executables,

now that we know it is supposed to flush the cache.
(Was thought to be "some obscure FPU operation".)
This commit is contained in:
gwr 1997-03-11 21:30:51 +00:00
parent 203dfd3486
commit 05a47d22ea
1 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.68 1997/02/18 15:37:57 gwr Exp $ */
/* $NetBSD: trap.c,v 1.69 1997/03/11 21:30:51 gwr Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@ -396,12 +396,16 @@ trap(type, code, v, tf)
case T_TRAP15|T_USER: /* SUN user trace trap */
#ifdef COMPAT_SUNOS
/*
* SunOS seems to use Trap #2 for some obscure fpu operations.
* So far, just ignore it, but DONT trap on it...
* (i.e. do not deliver a signal for it)
* SunOS uses Trap #2 for a "CPU cache flush"
* Just flush the on-chip caches and return.
* XXX - Too bad NetBSD uses trap 2...
*/
if (p->p_emul == &emul_sunos)
goto douret;
if (p->p_emul == &emul_sunos) {
ICIA();
DCIU();
/* get out fast */
goto done;
}
#endif
tf.tf_sr &= ~PSL_T;
sig = SIGTRAP;