Fixed FPU for single cpu

This commit is contained in:
Tomas Hruby
2010-09-16 09:51:45 +00:00
parent 72cc01ff48
commit 13bda81ee0
2 changed files with 10 additions and 5 deletions

View File

@@ -244,7 +244,7 @@ PUBLIC void fpu_init(void)
PUBLIC void save_local_fpu(struct proc *pr)
{
if(!fpu_presence)
if(!is_fpu())
return;
/* Save changed FPU context. */
@@ -258,9 +258,12 @@ PUBLIC void save_local_fpu(struct proc *pr)
PUBLIC void save_fpu(struct proc *pr)
{
#if CONFIG_SMP
#ifdef CONFIG_SMP
if (cpuid == pr->p_cpu) {
save_local_fpu(pr);
if (get_cpulocal_var(fpu_owner) == pr) {
disable_fpu_exception();
save_local_fpu(pr);
}
}
else {
int stopped;
@@ -280,7 +283,10 @@ PUBLIC void save_fpu(struct proc *pr)
RTS_UNSET(pr, RTS_PROC_STOP);
}
#else
save_local_fpu(pr);
if (get_cpulocal_var(fpu_owner) == pr) {
disable_fpu_exception();
save_local_fpu(pr);
}
#endif
}