| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: cpu_extended_state.h,v 1.7 2014/02/15 10:11:15 dsl Exp $ */ | | 1 | /* $NetBSD: cpu_extended_state.h,v 1.8 2014/02/18 18:39:10 dsl Exp $ */ |
2 | | | 2 | |
3 | #ifndef _X86_CPU_EXTENDED_STATE_H_ | | 3 | #ifndef _X86_CPU_EXTENDED_STATE_H_ |
4 | #define _X86_CPU_EXTENDED_STATE_H_ | | 4 | #define _X86_CPU_EXTENDED_STATE_H_ |
5 | | | 5 | |
6 | /* | | 6 | /* |
7 | * This file contains definitions of structures that match the memory | | 7 | * This file contains definitions of structures that match the memory |
8 | * layouts used x86 processors to save floating point registers and other | | 8 | * layouts used x86 processors to save floating point registers and other |
9 | * extended cpu state. | | 9 | * extended cpu state. |
10 | * This includes registers (etc) used by SSE/SSE2/SSE3/SSSE3/SSE4 and | | 10 | * This includes registers (etc) used by SSE/SSE2/SSE3/SSSE3/SSE4 and |
11 | * the later AVX instructions. | | 11 | * the later AVX instructions. |
12 | * The definitions are such that any future 'extended state' should | | 12 | * The definitions are such that any future 'extended state' should |
13 | * be handled (provided the kernel doesn't need to know the actual contents. | | 13 | * be handled (provided the kernel doesn't need to know the actual contents. |
14 | * | | 14 | * |
| @@ -105,31 +105,26 @@ struct fxsave { | | | @@ -105,31 +105,26 @@ struct fxsave { |
105 | uint8_t fx_tw; /* FPU Tag Word (abridged) */ | | 105 | uint8_t fx_tw; /* FPU Tag Word (abridged) */ |
106 | uint16_t fx_opcode; /* FPU Opcode */ | | 106 | uint16_t fx_opcode; /* FPU Opcode */ |
107 | union fp_addr fx_ip; /* FPU Instruction Pointer */ | | 107 | union fp_addr fx_ip; /* FPU Instruction Pointer */ |
108 | /*16*/ union fp_addr fx_dp; /* FPU Data pointer */ | | 108 | /*16*/ union fp_addr fx_dp; /* FPU Data pointer */ |
109 | uint32_t fx_mxcsr; /* MXCSR Register State */ | | 109 | uint32_t fx_mxcsr; /* MXCSR Register State */ |
110 | uint32_t fx_mxcsr_mask; | | 110 | uint32_t fx_mxcsr_mask; |
111 | struct fpaccfx fx_87_ac[8]; /* 8 x87 registers */ | | 111 | struct fpaccfx fx_87_ac[8]; /* 8 x87 registers */ |
112 | struct xmmreg fx_xmm[16]; /* XMM regs (8 in 32bit modes) */ | | 112 | struct xmmreg fx_xmm[16]; /* XMM regs (8 in 32bit modes) */ |
113 | uint8_t fx_rsvd[48]; | | 113 | uint8_t fx_rsvd[48]; |
114 | uint8_t fx_kernel[48]; /* Not written by the hardware */ | | 114 | uint8_t fx_kernel[48]; /* Not written by the hardware */ |
115 | } __aligned(16); | | 115 | } __aligned(16); |
116 | __CTASSERT_NOLINT(sizeof (struct fxsave) == 512); | | 116 | __CTASSERT_NOLINT(sizeof (struct fxsave) == 512); |
117 | | | 117 | |
118 | #ifndef _KERNEL | | | |
119 | /* Backwards compatibility for firefox (looks at fx_xmm) */ | | | |
120 | #define fxsave64 fxsave | | | |
121 | #endif | | | |
122 | | | | |
123 | /* The end of the fsave buffer can be used by the operating system */ | | 118 | /* The end of the fsave buffer can be used by the operating system */ |
124 | struct fxsave_os { | | 119 | struct fxsave_os { |
125 | uint8_t fxo_fxsave[512 - 48]; | | 120 | uint8_t fxo_fxsave[512 - 48]; |
126 | /* 48 bytes available, NB copied to/from userspace */ | | 121 | /* 48 bytes available, NB copied to/from userspace */ |
127 | uint16_t fxo_dflt_cw; /* Control word for signal handlers */ | | 122 | uint16_t fxo_dflt_cw; /* Control word for signal handlers */ |
128 | }; | | 123 | }; |
129 | | | 124 | |
130 | union savefpu { | | 125 | union savefpu { |
131 | struct save87 sv_87; | | 126 | struct save87 sv_87; |
132 | struct fxsave sv_xmm; | | 127 | struct fxsave sv_xmm; |
133 | struct fxsave_os sv_os; | | 128 | struct fxsave_os sv_os; |
134 | }; | | 129 | }; |
135 | | | 130 | |