diff options
author | jhb <jhb@FreeBSD.org> | 2009-03-05 19:42:11 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-03-05 19:42:11 +0000 |
commit | e1b708897ea547f25fbc5fc1f73bb2b0738c5757 (patch) | |
tree | 156c16702c286b02c436fdf8c8a1140bab925e8b /sys/compat/linux/linux_misc.h | |
parent | 217c09dffc7d5e0d80e98fe648855f9e3c1eee22 (diff) | |
download | FreeBSD-src-e1b708897ea547f25fbc5fc1f73bb2b0738c5757.zip FreeBSD-src-e1b708897ea547f25fbc5fc1f73bb2b0738c5757.tar.gz |
A better fix for handling different FPU initial control words for different
ABIs:
- Store the FPU initial control word in the pcb for each thread.
- When first using the FPU, load the initial control word after restoring
the clean state if it is not the standard control word.
- Provide a correct control word for Linux/i386 binaries under
FreeBSD/amd64.
- Adjust the control word returned for fpugetregs()/npxgetregs() when a
thread hasn't used the FPU yet to reflect the real initial control
word for the current ABI.
- The Linux/i386 ABI for FreeBSD/i386 now properly sets the right control
word instead of trashing whatever the current state of the FPU is.
Reviewed by: bde
Diffstat (limited to 'sys/compat/linux/linux_misc.h')
-rw-r--r-- | sys/compat/linux/linux_misc.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index 37991f3..eddcd2c 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -60,4 +60,9 @@ extern const char *linux_platform; */ #define LINUX_AT_EXECFN 31 /* filename of program */ +/* Linux sets the i387 to extended precision. */ +#if defined(__i386__) || defined(__amd64__) +#define __LINUX_NPXCW__ 0x37f +#endif + #endif /* _LINUX_MISC_H_ */ |