fix bug in save_fpu_state

This commit is contained in:
Stefan Lankes 2011-10-07 16:11:25 +02:00
parent 5fe4f8895b
commit 3bbba12ac9

View file

@ -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) {