From b722f788aadfe1ae47e6d2b5e0f623e8f5c6a7cf Mon Sep 17 00:00:00 2001 From: rgrimes Date: Sat, 28 Aug 1993 13:25:22 +0000 Subject: Changed trap.c so that a panic will occur if we do not have hardware FP and we try to call the emulator when it is not compiled in. Removed the #if defined(i486) || defined(i387) that use to call the panic if we did not have a math emulator. Removed an extranious include of i386/i386/math_emu.h from math_emulate.c. --- sys/amd64/amd64/trap.c | 6 +++++- sys/i386/i386/math_emulate.c | 7 ------- sys/i386/i386/trap.c | 6 +++++- sys/kern/subr_trap.c | 6 +++++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 22fc6da..545fdd3 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -43,7 +43,7 @@ * 08 Apr 93 Bruce Evans Several VM system fixes * Paul Kranenburg Add counter for vmstat */ -static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/trap.c,v 1.1.1.1 1993/06/12 14:58:05 rgrimes Exp $"; +static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/trap.c,v 1.2 1993/07/27 10:52:20 davidg Exp $"; /* * 386 Trap and System call handleing @@ -210,8 +210,12 @@ copyfault: /* if a transparent fault (due to context switch "late") */ if (npxdna()) return; #endif +#ifdef MATH_EMULATE i = math_emulate(&frame); if (i == 0) return; +#else /* MATH_EMULTATE */ + panic("trap: math emulation necessary!"); +#endif /* MATH_EMULTATE */ ucode = FPE_FPU_NP_TRAP; break; diff --git a/sys/i386/i386/math_emulate.c b/sys/i386/i386/math_emulate.c index 8d3cfcf..efe407f 100644 --- a/sys/i386/i386/math_emulate.c +++ b/sys/i386/i386/math_emulate.c @@ -78,10 +78,6 @@ put_fs_long(unsigned long val, unsigned long *adr) { (void)suword(adr,val); } math_emulate(struct trapframe * info) { -#if defined(i486) || defined(i387) - panic("math_emulate(), shouldn't happen with -Di486 or -Di387"); -} -#else unsigned short code; temp_real tmp; char * address; @@ -964,8 +960,6 @@ void fmul(const temp_real * src1, const temp_real * src2, temp_real * result) * temporary real division routine. */ -#include "i386/i386/math_emu.h" - static void shift_left(int * c) { __asm__ __volatile__("movl (%0),%%eax ; addl %%eax,(%0)\n\t" @@ -1484,4 +1478,3 @@ void int_to_real(const temp_int * a, temp_real * b) :"0" (b->a),"1" (b->b)); } } -#endif /* defined(i486) || defined(i387) */ diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 22fc6da..545fdd3 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -43,7 +43,7 @@ * 08 Apr 93 Bruce Evans Several VM system fixes * Paul Kranenburg Add counter for vmstat */ -static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/trap.c,v 1.1.1.1 1993/06/12 14:58:05 rgrimes Exp $"; +static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/trap.c,v 1.2 1993/07/27 10:52:20 davidg Exp $"; /* * 386 Trap and System call handleing @@ -210,8 +210,12 @@ copyfault: /* if a transparent fault (due to context switch "late") */ if (npxdna()) return; #endif +#ifdef MATH_EMULATE i = math_emulate(&frame); if (i == 0) return; +#else /* MATH_EMULTATE */ + panic("trap: math emulation necessary!"); +#endif /* MATH_EMULTATE */ ucode = FPE_FPU_NP_TRAP; break; diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 22fc6da..545fdd3 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -43,7 +43,7 @@ * 08 Apr 93 Bruce Evans Several VM system fixes * Paul Kranenburg Add counter for vmstat */ -static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/trap.c,v 1.1.1.1 1993/06/12 14:58:05 rgrimes Exp $"; +static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/trap.c,v 1.2 1993/07/27 10:52:20 davidg Exp $"; /* * 386 Trap and System call handleing @@ -210,8 +210,12 @@ copyfault: /* if a transparent fault (due to context switch "late") */ if (npxdna()) return; #endif +#ifdef MATH_EMULATE i = math_emulate(&frame); if (i == 0) return; +#else /* MATH_EMULTATE */ + panic("trap: math emulation necessary!"); +#endif /* MATH_EMULTATE */ ucode = FPE_FPU_NP_TRAP; break; -- cgit v1.1