Merge branch 'master' into ohligs

This commit is contained in:
Marian Ohligs 2011-05-30 22:48:00 +02:00
commit d92515f02a
2 changed files with 8 additions and 5 deletions

View file

@ -68,6 +68,13 @@ static inline void save_fpu_state(union fpu_state* state) {
asm volatile ("fsave %0; fwait" : "=m"((*state).fsave));
}
static inline void restore_fpu_state(union fpu_state* state) {
if (has_fxsr())
asm volatile ("fxrstor %0" :: "m"(state->fxsave));
else
asm volatile ("frstor %0" :: "m"(state->fsave));
}
#ifdef __cplusplus
}
#endif

View file

@ -196,11 +196,7 @@ static void fpu_handler(struct state *s)
task->flags |= TASK_FPU_INIT;
}
// restore the FPU context
if (has_fxsr())
asm volatile ("fxrstor %0" :: "m"(task->fpu.fxsave));
else
asm volatile ("frstor %0" :: "m"(task->fpu.fsave));
restore_fpu_state(&task->fpu);
task->flags |= TASK_FPU_USED;
}