From sun3:

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:
kleink 1997-07-08 16:56:31 +00:00
parent 5e57562634
commit 96914606be
5 changed files with 41 additions and 40 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.54 1997/04/09 19:33:18 thorpej Exp $ */
/* $NetBSD: trap.c,v 1.55 1997/07/08 16:56:31 kleink Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -531,9 +531,6 @@ trap(type, code, v, frame)
u_int ucode;
u_quad_t sticks = 0;
int i;
#ifdef COMPAT_SUNOS
extern struct emul emul_sunos;
#endif
p = curproc;
ucode = 0;
@ -664,13 +661,12 @@ 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.
*/
if (p->p_emul == &emul_sunos) {
userret(p, frame.f_pc, sticks);
ICIA();
DCIU();
return;
}
#endif
@ -736,9 +732,6 @@ syscall(code, frame)
size_t argsize;
register_t args[8], rval[2];
u_quad_t sticks;
#ifdef COMPAT_SUNOS
extern struct emul emul_sunos;
#endif
cnt.v_syscall++;
if (!USERMODE(frame.f_sr))

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.27 1997/06/04 14:33:53 leo Exp $ */
/* $NetBSD: trap.c,v 1.28 1997/07/08 16:56:34 kleink Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -334,9 +334,6 @@ trap(type, code, v, frame)
u_quad_t sticks;
int i;
extern char fubail[], subail[];
#ifdef COMPAT_SUNOS
extern struct emul emul_sunos;
#endif
p = curproc;
sticks = ucode = 0;
@ -504,13 +501,14 @@ 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.
*/
if (p->p_emul == &emul_sunos)
goto out;
if (p->p_emul == &emul_sunos) {
ICIA();
DCIU();
return;
}
#endif
frame.f_sr &= ~PSL_T;
i = SIGTRAP;
@ -996,9 +994,6 @@ syscall(code, frame)
size_t argsize;
register_t args[8], rval[2];
u_quad_t sticks;
#ifdef COMPAT_SUNOS
extern struct emul emul_sunos;
#endif
cnt.v_syscall++;
if (!USERMODE(frame.f_sr))

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.54 1997/05/19 10:15:01 veego Exp $ */
/* $NetBSD: trap.c,v 1.55 1997/07/08 16:56:36 kleink Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -482,13 +482,14 @@ trap(type, code, v, frame)
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.
*/
if (p->p_emul == &emul_sunos)
goto out;
if (p->p_emul == &emul_sunos) {
ICIA();
DCIU();
return;
}
#endif
frame.f_sr &= ~PSL_T;
i = SIGTRAP;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.9 1997/05/19 10:15:12 veego Exp $ */
/* $NetBSD: trap.c,v 1.10 1997/07/08 16:56:38 kleink Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -424,6 +424,17 @@ copyfault:
case T_TRACE|T_USER: /* user trace trap */
case T_TRAP15|T_USER: /* SUN user trace trap */
#ifdef COMPAT_SUNOS
/*
* SunOS uses Trap #2 for a "CPU cache flush".
* Just flush the on-chip caches and return.
*/
if (p->p_emul == &emul_sunos) {
ICIA();
DCIA();
return();
}
#endif COMPAT_SUNOS
frame.f_sr &= ~PSL_T;
i = SIGTRAP;
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.9 1997/06/11 08:46:55 kleink Exp $ */
/* $NetBSD: trap.c,v 1.10 1997/07/08 16:56:40 kleink Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -485,13 +485,14 @@ trap(type, code, v, frame)
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.
*/
if (p->p_emul == &emul_sunos)
goto out;
if (p->p_emul == &emul_sunos) {
ICIA();
DCIU();
return;
}
#endif
frame.f_sr &= ~PSL_T;
i = SIGTRAP;