From fc6fb65d624e2c6e2efc28184a1d725c0e43087f Mon Sep 17 00:00:00 2001 From: briggs Date: Sun, 25 Jun 1995 02:45:14 +0000 Subject: [PATCH] Do something a lot closer to the right thing for FPU_EMULATE/FPSP/040 and subsets thereof. --- sys/arch/mac68k/mac68k/locore.s | 25 ++++++++++++++++--------- sys/arch/mac68k/mac68k/trap.c | 4 ++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/sys/arch/mac68k/mac68k/locore.s b/sys/arch/mac68k/mac68k/locore.s index 96ef8d7e7aba..0ee332d359fd 100644 --- a/sys/arch/mac68k/mac68k/locore.s +++ b/sys/arch/mac68k/mac68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.37 1995/06/21 03:36:27 briggs Exp $ */ +/* $NetBSD: locore.s,v 1.38 1995/06/25 02:45:14 briggs Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -270,17 +270,22 @@ Lstkadj: */ _fpfline: #if defined(M68040) - cmpw #0x202c,sp@(6) | format type 2? - jne _illinst | no, not an FP emulation + cmpl #MMU_68040,_mmutype | 68040? + jne Lfp_unimp | no, skip FPSP + cmpw #0x202c,sp@(6) | format type 2? + jne _illinst | no, treat as illinst +Ldofp_unimp: #ifdef FPSP .globl fpsp_unimp - jmp fpsp_unimp | yes, go handle it -#else + jmp fpsp_unimp | go handle in fpsp +#endif +Lfp_unimp: +#endif +#ifdef FPU_EMULATE clrl sp@- | pad SR to longword moveml #0xFFFF,sp@- | save user registers moveq #T_FPEMULI,d0 | denote it as an FP emulation trap. jra fault | do it. -#endif #else jra _illinst #endif @@ -288,16 +293,18 @@ _fpfline: _fpunsupp: #if defined(M68040) cmpl #MMU_68040,_mmutype | 68040? - jne _illinst | no, treat as illinst + jne Lfp_unsupp | no, treat as illinst #ifdef FPSP .globl fpsp_unsupp jmp fpsp_unsupp | yes, go handle it -#else +#endif +Lfp_unsupp: +#endif +#ifdef FPU_EMULATE clrl sp@- | pad SR to longword moveml #0xFFFF,sp@- | save user registers moveq #T_FPEMULD,d0 | denote it as an FP emulation trap. jra fault | do it. -#endif #else jra _illinst #endif diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c index 724c16ecc6db..c81d6ec022e3 100644 --- a/sys/arch/mac68k/mac68k/trap.c +++ b/sys/arch/mac68k/mac68k/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.29 1995/06/21 03:45:21 briggs Exp $ */ +/* $NetBSD: trap.c,v 1.30 1995/06/25 02:45:17 briggs Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -549,7 +549,7 @@ copyfault: break; } } - trapsignal(p, i, ucode); + if (i) trapsignal(p, i, ucode); if ((type & T_USER) == 0) return; out: