From 3af24d7d1fb78a6bb4e0aad5ec4e0607a6c6b4d2 Mon Sep 17 00:00:00 2001 From: briggs Date: Tue, 8 Apr 1997 05:14:52 +0000 Subject: [PATCH] Fix from NetBSD: flush caches on trap 2 in SunOS emulation. Comment on mac68k change by scottr attributes Gordon (Ross) on the change. --- sys/arch/atari/atari/trap.c | 11 ++++++----- sys/arch/mvme68k/mvme68k/trap.c | 12 +++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/arch/atari/atari/trap.c b/sys/arch/atari/atari/trap.c index 7d6858d1933..9055e0afb6c 100644 --- a/sys/arch/atari/atari/trap.c +++ b/sys/arch/atari/atari/trap.c @@ -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; diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index 9a4ed40be2d..7dfa8b2d7f5 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -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; } -- 2.20.1