diff options
| -rw-r--r-- | arch/x86/include/asm/i387.h | 12 | ||||
| -rw-r--r-- | arch/x86/kernel/i387.c | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 768fcb25900..42b507e16d1 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
| @@ -55,6 +55,12 @@ extern int save_i387_xstate_ia32(void __user *buf); | |||
| 55 | extern int restore_i387_xstate_ia32(void __user *buf); | 55 | extern int restore_i387_xstate_ia32(void __user *buf); |
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | #ifdef CONFIG_MATH_EMULATION | ||
| 59 | extern void finit_soft_fpu(struct i387_soft_struct *soft); | ||
| 60 | #else | ||
| 61 | static inline void finit_soft_fpu(struct i387_soft_struct *soft) {} | ||
| 62 | #endif | ||
| 63 | |||
| 58 | #define X87_FSW_ES (1 << 7) /* Exception Summary */ | 64 | #define X87_FSW_ES (1 << 7) /* Exception Summary */ |
| 59 | 65 | ||
| 60 | static __always_inline __pure bool use_xsaveopt(void) | 66 | static __always_inline __pure bool use_xsaveopt(void) |
| @@ -189,12 +195,6 @@ static inline void fpu_save_init(struct fpu *fpu) | |||
| 189 | 195 | ||
| 190 | #else /* CONFIG_X86_32 */ | 196 | #else /* CONFIG_X86_32 */ |
| 191 | 197 | ||
| 192 | #ifdef CONFIG_MATH_EMULATION | ||
| 193 | extern void finit_soft_fpu(struct i387_soft_struct *soft); | ||
| 194 | #else | ||
| 195 | static inline void finit_soft_fpu(struct i387_soft_struct *soft) {} | ||
| 196 | #endif | ||
| 197 | |||
| 198 | /* perform fxrstor iff the processor has extended states, otherwise frstor */ | 198 | /* perform fxrstor iff the processor has extended states, otherwise frstor */ |
| 199 | static inline int fxrstor_checking(struct i387_fxsave_struct *fx) | 199 | static inline int fxrstor_checking(struct i387_fxsave_struct *fx) |
| 200 | { | 200 | { |
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index f3775f5ef4a..e795e360bd5 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
| @@ -79,10 +79,8 @@ static void __cpuinit init_thread_xstate(void) | |||
| 79 | 79 | ||
| 80 | if (cpu_has_fxsr) | 80 | if (cpu_has_fxsr) |
| 81 | xstate_size = sizeof(struct i387_fxsave_struct); | 81 | xstate_size = sizeof(struct i387_fxsave_struct); |
| 82 | #ifdef CONFIG_X86_32 | ||
| 83 | else | 82 | else |
| 84 | xstate_size = sizeof(struct i387_fsave_struct); | 83 | xstate_size = sizeof(struct i387_fsave_struct); |
| 85 | #endif | ||
| 86 | } | 84 | } |
| 87 | 85 | ||
| 88 | /* | 86 | /* |
| @@ -119,12 +117,10 @@ void __cpuinit fpu_init(void) | |||
| 119 | 117 | ||
| 120 | void fpu_finit(struct fpu *fpu) | 118 | void fpu_finit(struct fpu *fpu) |
| 121 | { | 119 | { |
| 122 | #ifdef CONFIG_X86_32 | ||
| 123 | if (!HAVE_HWFP) { | 120 | if (!HAVE_HWFP) { |
| 124 | finit_soft_fpu(&fpu->state->soft); | 121 | finit_soft_fpu(&fpu->state->soft); |
| 125 | return; | 122 | return; |
| 126 | } | 123 | } |
| 127 | #endif | ||
| 128 | 124 | ||
| 129 | if (cpu_has_fxsr) { | 125 | if (cpu_has_fxsr) { |
| 130 | struct i387_fxsave_struct *fx = &fpu->state->fxsave; | 126 | struct i387_fxsave_struct *fx = &fpu->state->fxsave; |
