Use a critical region to protect saving of the npx state in savectx().

Not doing this was fairly harmless because savectx() is only called
for panic dumps and the bug could at worse reset the state.

savectx() is still missing saving of (volatile) debug registers, and
still isn't called for core dumps.
This commit is contained in:
Bruce Evans 2001-05-20 16:51:08 +00:00
parent c5c4ac3fb8
commit c2b095ab72
3 changed files with 12 additions and 3 deletions

View File

@ -327,6 +327,8 @@ ENTRY(savectx)
* have to handle h/w bugs for reloading. We used to lose the
* parent's npx state for forks by forgetting to reload.
*/
pushfl
cli
movl PCPU(NPXPROC),%eax
testl %eax,%eax
je 1f
@ -347,7 +349,8 @@ ENTRY(savectx)
pushl %eax
call bcopy
addl $12,%esp
1:
popfl
#endif /* DEV_NPX */
1:
ret

View File

@ -327,6 +327,8 @@ ENTRY(savectx)
* have to handle h/w bugs for reloading. We used to lose the
* parent's npx state for forks by forgetting to reload.
*/
pushfl
cli
movl PCPU(NPXPROC),%eax
testl %eax,%eax
je 1f
@ -347,7 +349,8 @@ ENTRY(savectx)
pushl %eax
call bcopy
addl $12,%esp
1:
popfl
#endif /* DEV_NPX */
1:
ret

View File

@ -327,6 +327,8 @@ ENTRY(savectx)
* have to handle h/w bugs for reloading. We used to lose the
* parent's npx state for forks by forgetting to reload.
*/
pushfl
cli
movl PCPU(NPXPROC),%eax
testl %eax,%eax
je 1f
@ -347,7 +349,8 @@ ENTRY(savectx)
pushl %eax
call bcopy
addl $12,%esp
1:
popfl
#endif /* DEV_NPX */
1:
ret