From 3bbba12ac90a404a926e6aae80a4b8db0308399d Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 7 Oct 2011 16:11:25 +0200 Subject: [PATCH] fix bug in save_fpu_state --- arch/x86/include/asm/tasks_types.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/tasks_types.h b/arch/x86/include/asm/tasks_types.h index 34c01228..194a0410 100644 --- a/arch/x86/include/asm/tasks_types.h +++ b/arch/x86/include/asm/tasks_types.h @@ -50,10 +50,14 @@ typedef struct i387_fxsave_struct { long foo; long fos; long mxcsr; - long reserved; + long mxcsr_mask; long st_space[32]; - long xmm_space[32]; - long padding[56]; + long xmm_space[64]; + long padding[12]; + union { + long padding1[12]; + long sw_reserved[12]; + }; } i387_fxsave_t __attribute__ ((aligned (16))); union fpu_state { @@ -63,9 +67,9 @@ union fpu_state { static inline void save_fpu_state(union fpu_state* state) { if (has_fxsr()) - asm volatile ("fxsave %0; fnclex" : "=m"((*state).fxsave)); + asm volatile ("fxsave %0; fnclex" : "=m"((*state).fxsave) :: "memory"); else - asm volatile ("fsave %0; fwait" : "=m"((*state).fsave)); + asm volatile ("fnsave %0; fwait" : "=m"((*state).fsave) :: "memory"); } static inline void restore_fpu_state(union fpu_state* state) {