pc64: fix mistake fpurestore() mistake
cannot just reenable the fpu in FPactive case as we might have been procsaved() an rescheduled on another cpu. what was i thinking... thanks qu7uux for reproducing the problem.
This commit is contained in:
parent
f4880742fd
commit
753f64a877
1 changed files with 10 additions and 5 deletions
|
@ -712,20 +712,25 @@ int
|
|||
fpusave(void)
|
||||
{
|
||||
int ostate = up->fpstate;
|
||||
if((up->fpstate & ~(FPnouser|FPkernel|FPindexm)) == FPactive)
|
||||
if((ostate & ~(FPnouser|FPkernel|FPindexm)) == FPactive)
|
||||
_stts();
|
||||
up->fpstate = FPpush | (up->fpstate & ~FPillegal);
|
||||
up->fpstate = FPpush | (ostate & ~FPillegal);
|
||||
return ostate;
|
||||
}
|
||||
void
|
||||
fpurestore(int ostate)
|
||||
{
|
||||
if((up->fpstate & ~(FPnouser|FPkernel|FPindexm)) == FPactive)
|
||||
int astate = up->fpstate;
|
||||
if((astate & ~(FPnouser|FPkernel|FPindexm)) == FPactive)
|
||||
_stts();
|
||||
if((ostate & FPindexm) == (up->fpstate & FPindexm)){
|
||||
if((ostate & ~(FPnouser|FPkernel|FPindexm)) == FPactive)
|
||||
if((astate & FPindexm) == (ostate & FPindexm)){
|
||||
if((ostate & ~(FPnouser|FPkernel|FPindexm)) == FPactive){
|
||||
if((astate & ~(FPpush|FPnouser|FPkernel|FPindexm)) != FPactive)
|
||||
goto saved;
|
||||
_clts();
|
||||
}
|
||||
} else {
|
||||
saved:
|
||||
up->fpsave = up->fpslot[ostate>>FPindexs];
|
||||
ostate = FPinactive | (ostate & (FPillegal|FPpush|FPnouser|FPkernel|FPindexm));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue