123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- #ifndef _MACHINE_NPX_H_
- #define _MACHINE_NPX_H_
- struct env87 {
- long en_cw;
- long en_sw;
- long en_tw;
- long en_fip;
- unsigned short en_fcs;
- unsigned short en_opcode;
- long en_foo;
- long en_fos;
- };
- struct fpacc87 {
- #ifdef dontdef
- unsigned long fp_mantlo;
- unsigned long fp_manthi;
- int fp_exp:15;
- int fp_sgn:1;
- #else
- unsigned char fp_bytes[10];
- #endif
- };
- struct save87 {
- struct env87 sv_env;
- struct fpacc87 sv_ac[8];
- unsigned char sv_pad0[4];
-
- unsigned char sv_pad[64];
- };
- struct envxmm {
- uint16_t en_cw;
- uint16_t en_sw;
- uint16_t en_tw;
- uint16_t en_opcode;
- uint32_t en_fip;
- uint16_t en_fcs;
- uint16_t en_pad0;
- uint32_t en_foo;
- uint16_t en_fos;
- uint16_t en_pad1;
- uint32_t en_mxcsr;
- uint32_t en_mxcsr_mask;
- };
- struct xmmacc {
- unsigned char xmm_bytes[16];
- };
- struct savexmm {
- struct envxmm sv_env;
- struct {
- struct fpacc87 fp_acc;
- unsigned char fp_pad[6];
- } sv_fp[8];
- struct xmmacc sv_xmm[8];
- unsigned char sv_pad[224];
- } __attribute__((__aligned__(16)));
- union savefpu {
- struct save87 sv_87;
- struct savexmm sv_xmm;
- };
- #define __INITIAL_NPXCW__ 0x127F
- #define __INITIAL_MXCSR__ 0x1F80
- #ifdef _KERNEL
- #define IO_NPX 0x0F0
- #define IO_NPXSIZE 16
- #define IRQ_NPX 13
- #define npx_full_reset() outb(IO_NPX + 1, 0)
- int npxdna(void);
- void npxdrop(void);
- void npxexit(struct thread *td);
- int npxformat(void);
- int npxgetregs(struct thread *td, union savefpu *addr);
- void npxinit(unsigned short control);
- void npxsave(union savefpu *addr);
- void npxsetregs(struct thread *td, union savefpu *addr);
- int npxtrap(void);
- #endif
- #endif
|