summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-08-27 10:46:56 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-08-27 10:46:56 +0000
commit889b6c4c11911ab87d3470d9ffc9b559183a51dc (patch)
treea0b782bd0d9d1f1f65e79e0ecc9bf21bb0aa924c /sys/arch/i386/include
parentd8270b44b1f22944ea7aaaf8e11b8ddc7fbf94aa (diff)
Add:
* GPL_MATH_EMULATE: fpemul * ALWAYS_MATH_EMULATE: causes npx probe to always fail. * better fp context in struct pcb.
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/cpu.h2
-rw-r--r--sys/arch/i386/include/npx.h28
-rw-r--r--sys/arch/i386/include/pcb.h2
3 files changed, 22 insertions, 10 deletions
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 3abe70557f5..8cf15de524c 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -165,7 +165,7 @@ void startrtclock __P((void));
void npxdrop __P((void));
void npxsave __P((void));
-#ifdef MATH_EMULATE
+#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE)
/* math_emulate.c */
int math_emulate __P((struct trapframe *));
#endif
diff --git a/sys/arch/i386/include/npx.h b/sys/arch/i386/include/npx.h
index 58feae9ea33..5d23bcf7d0d 100644
--- a/sys/arch/i386/include/npx.h
+++ b/sys/arch/i386/include/npx.h
@@ -70,14 +70,25 @@ struct fpacc87 {
#endif
};
-/* Floating point context */
+#ifdef GPL_MATH_EMULATE
+#include <gnu/arch/i386/fpemul/math_emu.h>
+#endif
+
+/* Floating point and emulator context */
struct save87 {
struct env87 sv_env; /* floating point control/status */
- struct fpacc87 sv_ac[8]; /* accumulator contents, 0-7 */
-#ifndef dontdef
- u_long sv_ex_sw; /* status word for last exception (was pad) */
- u_long sv_ex_tw; /* tag word for last exception (was pad) */
- u_char sv_pad[8 * 2 - 2 * 4]; /* bogus historical padding */
+ struct fpacc87 sv_ac[8]; /* accumulator contents, 0-7 */
+ u_long sv_ex_sw; /* status word for last exception */
+ u_long sv_ex_tw; /* tag word for last exception */
+};
+
+/* For the pcb. */
+union fsave87 {
+ struct save87 npx;
+#ifdef GPL_MATH_EMULATE
+ union i387_union gplemu;
+#else
+ u_char emupad[176]; /* sizeof(i387_union) */
#endif
};
@@ -90,7 +101,8 @@ struct emcsts {
/* Intel prefers long real (53 bit) precision */
#define __iBCS_NPXCW__ 0x262
-#define __NetBSD_NPXCW__ 0x127f
+#define __BDE_NPXCW__ 0x1272 /* FreeBSD */
+#define __OpenBSD_NPXCW__ 0x127f
/*
* The standard control word from finit is 0x37F, giving:
@@ -115,6 +127,6 @@ struct emcsts {
* trapping denormals.
*/
-#define __INITIAL_NPXCW__ __NetBSD_NPXCW__
+#define __INITIAL_NPXCW__ __OpenBSD_NPXCW__
#endif /* !_I386_NPX_H_ */
diff --git a/sys/arch/i386/include/pcb.h b/sys/arch/i386/include/pcb.h
index 3cff2b28c2d..33ea0e21661 100644
--- a/sys/arch/i386/include/pcb.h
+++ b/sys/arch/i386/include/pcb.h
@@ -67,7 +67,7 @@ struct pcb {
union descriptor *pcb_ldt; /* per process (user) LDT */
int pcb_ldt_len; /* number of LDT entries */
int pcb_cr0; /* saved image of CR0 */
- struct save87 pcb_savefpu; /* floating point state for 287/387 */
+ union fsave87 pcb_savefpu; /* floating point state for 287/387 */
struct emcsts pcb_saveemc; /* Cyrix EMC state */
/*
* Software pcb (extension)