diff options
-rw-r--r-- | sys/gnu/arch/i386/fpemul/fpu_entry.c | 80 | ||||
-rw-r--r-- | sys/gnu/arch/i386/fpemul/fpu_system.h | 6 | ||||
-rw-r--r-- | sys/gnu/arch/i386/fpemul/load_store.c | 5 | ||||
-rw-r--r-- | sys/gnu/arch/i386/fpemul/reg_ld_str.c | 5 |
4 files changed, 6 insertions, 90 deletions
diff --git a/sys/gnu/arch/i386/fpemul/fpu_entry.c b/sys/gnu/arch/i386/fpemul/fpu_entry.c index 640c5a1046e..8427ccadf1c 100644 --- a/sys/gnu/arch/i386/fpemul/fpu_entry.c +++ b/sys/gnu/arch/i386/fpemul/fpu_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_entry.c,v 1.2 2003/01/09 22:27:11 miod Exp $ */ +/* $OpenBSD: fpu_entry.c,v 1.3 2003/07/30 20:24:03 jason Exp $ */ /* * fpu_entry.c * @@ -77,10 +77,6 @@ #include <sys/proc.h> #include <sys/kernel.h> -#if defined(LKM) && defined(__FreeBSD__) -#include <sys/lkm.h> -#endif - #include <machine/cpu.h> #include <machine/pcb.h> @@ -199,11 +195,7 @@ char emulating = 0; #define math_abort(signo) \ FPU_EIP = FPU_ORIG_EIP;REENTRANT_CHECK(OFF);return(signo); -#if defined(__FreeBSD__) -static int -#else int -#endif math_emulate(struct trapframe * tframe) { @@ -212,6 +204,7 @@ math_emulate(struct trapframe * tframe) #ifdef LOOKAHEAD_LIMIT int lookahead_limit = LOOKAHEAD_LIMIT; #endif + #ifdef PARANOID if (emulating) { printf("ERROR: wm-FPU-emu is not RE-ENTRANT!\n"); @@ -219,13 +212,6 @@ math_emulate(struct trapframe * tframe) REENTRANT_CHECK(ON); #endif /* PARANOID */ -#if defined(__FreeBSD__) - if ((((struct pcb *) curproc->p_addr)->pcb_flags & FP_SOFTFP) == 0) { - finit(); - control_word = __INITIAL_NPXCW__; - ((struct pcb *) curproc->p_addr)->pcb_flags |= FP_SOFTFP; - } -#else if (!USERMODE(tframe->tf_cs, tframe->tf_eflags)) panic("math emulator called from supervisor mode"); @@ -235,24 +221,10 @@ math_emulate(struct trapframe * tframe) finit(); control_word = __INITIAL_NPXCW__; } -#endif + FPU_info = tframe; FPU_ORIG_EIP = FPU_EIP; /* --pink-- */ -#if defined(__FreeBSD__) - if (FPU_CS != 0x001f) { - printf("math_emulate: %x : %x\n", FPU_CS, FPU_EIP); - panic("FPU emulation in kernel"); - } -#endif -#ifdef notyet - /* We cannot handle emulation in v86-mode */ - if (FPU_EFLAGS & 0x00020000) { - FPU_ORIG_EIP = FPU_EIP; - math_abort(FPU_info, SIGILL); - } -#endif - FPU_lookahead = FPU_LOOKAHEAD; if (curproc->p_flag & P_TRACED) FPU_lookahead = 0; @@ -507,49 +479,3 @@ if (--lookahead_limit) REENTRANT_CHECK(OFF); return (0); /* --pink-- */ } - -#if defined(__FreeBSD__) -#ifdef LKM -MOD_MISC(gnufpu); -static int -gnufpu_load(struct lkm_table *lkmtp, int cmd) -{ - if (pmath_emulate) { - printf("Math emulator already present\n"); - return EBUSY; - } - pmath_emulate = math_emulate; - return 0; -} - -static int -gnufpu_unload(struct lkm_table *lkmtp, int cmd) -{ - if (pmath_emulate != math_emulate) { - printf("Cannot unload another math emulator\n"); - return EACCES; - } - pmath_emulate = 0; - return 0; -} - -int -gnufpu(struct lkm_table *lkmtp, int cmd, int ver) -{ - DISPATCH(lkmtp, cmd, ver, gnufpu_load, gnufpu_unload, lkm_nullcmd); -} -#else /* !LKM */ - -static void -gnufpu_init(void *unused) -{ - if (pmath_emulate) - printf("Another Math emulator already present\n"); - else - pmath_emulate = math_emulate; -} - -SYSINIT(gnufpu, SI_SUB_CPU, SI_ORDER_ANY, gnufpu_init, NULL); - -#endif /* LKM */ -#endif /* __FreeBSD__ */ diff --git a/sys/gnu/arch/i386/fpemul/fpu_system.h b/sys/gnu/arch/i386/fpemul/fpu_system.h index 5d3a3cebb5c..2f4e9a1cc8c 100644 --- a/sys/gnu/arch/i386/fpemul/fpu_system.h +++ b/sys/gnu/arch/i386/fpemul/fpu_system.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_system.h,v 1.1 1996/08/27 10:32:49 downsj Exp $ */ +/* $OpenBSD: fpu_system.h,v 1.2 2003/07/30 20:24:03 jason Exp $ */ /* * fpu_system.h * @@ -70,11 +70,7 @@ #include <linux/kernel.h> */ -#if defined(__FreeBSD__) -#define I387 (*(union i387_union *)&(((struct pcb *)curproc->p_addr)->pcb_savefpu)) -#else #define I387 (*(union i387_union *)&(((struct pcb *)curproc->p_addr)->pcb_savefpu.gplemu)) -#endif #define FPU_info (I387.soft.frame) #define FPU_CS (*(unsigned short *) &(FPU_info->tf_cs)) diff --git a/sys/gnu/arch/i386/fpemul/load_store.c b/sys/gnu/arch/i386/fpemul/load_store.c index c08090f900f..a01a4b87e3a 100644 --- a/sys/gnu/arch/i386/fpemul/load_store.c +++ b/sys/gnu/arch/i386/fpemul/load_store.c @@ -1,4 +1,4 @@ -/* $OpenBSD: load_store.c,v 1.2 2003/01/09 22:27:11 miod Exp $ */ +/* $OpenBSD: load_store.c,v 1.3 2003/07/30 20:24:03 jason Exp $ */ /* * load_store.c * @@ -73,9 +73,6 @@ #include <sys/proc.h> #include <sys/systm.h> #include <machine/cpu.h> -#if defined(__FreeBSD__) -#include <machine/md_var.h> -#endif #include <machine/pcb.h> #include <gnu/arch/i386/fpemul/fpu_emu.h> diff --git a/sys/gnu/arch/i386/fpemul/reg_ld_str.c b/sys/gnu/arch/i386/fpemul/reg_ld_str.c index 924275393fd..6c4bef61011 100644 --- a/sys/gnu/arch/i386/fpemul/reg_ld_str.c +++ b/sys/gnu/arch/i386/fpemul/reg_ld_str.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reg_ld_str.c,v 1.2 2003/01/09 22:27:12 miod Exp $ */ +/* $OpenBSD: reg_ld_str.c,v 1.3 2003/07/30 20:24:03 jason Exp $ */ /* * reg_ld_str.c * @@ -72,9 +72,6 @@ #include <sys/proc.h> #include <sys/systm.h> #include <machine/cpu.h> -#if defined(__FreeBSD__) -#include <machine/md_var.h> -#endif #include <machine/pcb.h> #include <gnu/arch/i386/fpemul/fpu_emu.h> |