diff options
| author | Bruce Evans <bde@FreeBSD.org> | 2001-05-20 18:05:44 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 2001-05-20 18:05:44 +0000 |
| commit | 701027893593af653bfbf02a04631d5baf9502b6 (patch) | |
| tree | fec46b066bc7c5e8db988387e2a87db02a01e69c /sys | |
| parent | 259089eefc8d33749e9d627d9d46d24a3dd295fc (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/amd64/amd64/fpu.c | 6 | ||||
| -rw-r--r-- | sys/amd64/isa/npx.c | 6 | ||||
| -rw-r--r-- | sys/i386/isa/npx.c | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index a57bffc745c6..477f7ba233c7 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -484,6 +484,7 @@ npxinit(control) u_short control; { struct save87 dummy; + critical_t savecrit; if (!npx_exists) return; @@ -492,12 +493,14 @@ npxinit(control) * fnsave to throw away any junk in the fpu. npxsave() initializes * the fpu and sets npxproc = NULL as important side effects. */ + savecrit = critical_enter(); npxsave(&dummy); stop_emulating(); fldcw(&control); if (PCPU_GET(curpcb) != NULL) fnsave(&PCPU_GET(curpcb)->pcb_savefpu); start_emulating(); + critical_exit(savecrit); } /* @@ -507,9 +510,12 @@ void npxexit(p) struct proc *p; { + critical_t savecrit; + savecrit = critical_enter(); if (p == PCPU_GET(npxproc)) npxsave(&PCPU_GET(curpcb)->pcb_savefpu); + critical_exit(savecrit); #ifdef NPX_DEBUG if (npx_exists) { u_int masked_exceptions; diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c index a57bffc745c6..477f7ba233c7 100644 --- a/sys/amd64/isa/npx.c +++ b/sys/amd64/isa/npx.c @@ -484,6 +484,7 @@ npxinit(control) u_short control; { struct save87 dummy; + critical_t savecrit; if (!npx_exists) return; @@ -492,12 +493,14 @@ npxinit(control) * fnsave to throw away any junk in the fpu. npxsave() initializes * the fpu and sets npxproc = NULL as important side effects. */ + savecrit = critical_enter(); npxsave(&dummy); stop_emulating(); fldcw(&control); if (PCPU_GET(curpcb) != NULL) fnsave(&PCPU_GET(curpcb)->pcb_savefpu); start_emulating(); + critical_exit(savecrit); } /* @@ -507,9 +510,12 @@ void npxexit(p) struct proc *p; { + critical_t savecrit; + savecrit = critical_enter(); if (p == PCPU_GET(npxproc)) npxsave(&PCPU_GET(curpcb)->pcb_savefpu); + critical_exit(savecrit); #ifdef NPX_DEBUG if (npx_exists) { u_int masked_exceptions; diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index a57bffc745c6..477f7ba233c7 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -484,6 +484,7 @@ npxinit(control) u_short control; { struct save87 dummy; + critical_t savecrit; if (!npx_exists) return; @@ -492,12 +493,14 @@ npxinit(control) * fnsave to throw away any junk in the fpu. npxsave() initializes * the fpu and sets npxproc = NULL as important side effects. */ + savecrit = critical_enter(); npxsave(&dummy); stop_emulating(); fldcw(&control); if (PCPU_GET(curpcb) != NULL) fnsave(&PCPU_GET(curpcb)->pcb_savefpu); start_emulating(); + critical_exit(savecrit); } /* @@ -507,9 +510,12 @@ void npxexit(p) struct proc *p; { + critical_t savecrit; + savecrit = critical_enter(); if (p == PCPU_GET(npxproc)) npxsave(&PCPU_GET(curpcb)->pcb_savefpu); + critical_exit(savecrit); #ifdef NPX_DEBUG if (npx_exists) { u_int masked_exceptions; |
