SMP - lazy FPU
- when a process is migrated to a different CPU it may have an active FPU context in the processor registers. We must save it and migrate it together with the process.
This commit is contained in:
@@ -43,10 +43,7 @@ PUBLIC int do_getmcontext(struct proc * caller, message * m_ptr)
|
||||
mc.mc_fpu_flags = 0;
|
||||
if (proc_used_fpu(rp)) {
|
||||
/* make sure that the FPU context is saved into proc structure first */
|
||||
if (fpu_owner == rp) {
|
||||
disable_fpu_exception();
|
||||
save_fpu(rp);
|
||||
}
|
||||
save_fpu(rp);
|
||||
mc.mc_fpu_flags = 0 | rp->p_misc_flags & MF_FPU_INITIALIZED;
|
||||
memcpy(&(mc.mc_fpu_state), rp->p_fpu_state.fpu_save_area_p,
|
||||
FPU_XFP_SIZE);
|
||||
@@ -92,8 +89,7 @@ PUBLIC int do_setmcontext(struct proc * caller, message * m_ptr)
|
||||
} else
|
||||
rp->p_misc_flags &= ~MF_FPU_INITIALIZED;
|
||||
/* force reloading FPU in either case */
|
||||
if (fpu_owner == rp)
|
||||
release_fpu();
|
||||
release_fpu(rp);
|
||||
#endif
|
||||
|
||||
return(OK);
|
||||
|
||||
Reference in New Issue
Block a user