From 05a47d22ea2e6f80fa3846eecee8fa6291e8370b Mon Sep 17 00:00:00 2001 From: gwr Date: Tue, 11 Mar 1997 21:30:51 +0000 Subject: [PATCH] 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".) --- sys/arch/sun3/sun3/trap.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/arch/sun3/sun3/trap.c b/sys/arch/sun3/sun3/trap.c index 8dbcb63e8434..b44ee3bcb643 100644 --- a/sys/arch/sun3/sun3/trap.c +++ b/sys/arch/sun3/sun3/trap.c @@ -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;