diff options
author | imp <imp@FreeBSD.org> | 2002-03-21 06:19:08 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-03-21 06:19:08 +0000 |
commit | a85d713abc53071579d19131d57efd1905020036 (patch) | |
tree | 77fc4b8fd214e6d26b72d4c672eb8578196b0b43 /sys/amd64/isa | |
parent | dd261cc76ac7701beaf386498c3f3d3be8225619 (diff) | |
download | FreeBSD-src-a85d713abc53071579d19131d57efd1905020036.zip FreeBSD-src-a85d713abc53071579d19131d57efd1905020036.tar.gz |
Fix abuses of cpu_critical_{enter,exit} by converting to
intr_{disable,restore} as well as providing an implemenation of
intr_{disable,restore}.
Reviewed by: jake, rwatson, jhb
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r-- | sys/amd64/isa/npx.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c index d3d6a01..50dfb9e 100644 --- a/sys/amd64/isa/npx.c +++ b/sys/amd64/isa/npx.c @@ -512,7 +512,7 @@ npxinit(control) u_short control; { static union savefpu dummy; - critical_t savecrit; + register_t savecrit; if (!npx_exists) return; @@ -521,7 +521,7 @@ npxinit(control) * fnsave to throw away any junk in the fpu. npxsave() initializes * the fpu and sets fpcurthread = NULL as important side effects. */ - savecrit = cpu_critical_enter(); + savecrit = intr_disable(); npxsave(&dummy); stop_emulating(); #ifdef CPU_ENABLE_SSE @@ -533,7 +533,7 @@ npxinit(control) if (PCPU_GET(curpcb) != NULL) fpusave(&PCPU_GET(curpcb)->pcb_save); start_emulating(); - cpu_critical_exit(savecrit); + intr_restore(savecrit); } /* @@ -543,12 +543,12 @@ void npxexit(td) struct thread *td; { - critical_t savecrit; + register_t savecrit; - savecrit = cpu_critical_enter(); + savecrit = intr_disable(); if (td == PCPU_GET(fpcurthread)) npxsave(&PCPU_GET(curpcb)->pcb_save); - cpu_critical_exit(savecrit); + intr_restore(savecrit); #ifdef NPX_DEBUG if (npx_exists) { u_int masked_exceptions; @@ -759,7 +759,7 @@ static char fpetable[128] = { int npxtrap() { - critical_t savecrit; + register_t savecrit; u_short control, status; u_long *exstat; @@ -768,7 +768,7 @@ npxtrap() PCPU_GET(fpcurthread), curthread, npx_exists); panic("npxtrap from nowhere"); } - savecrit = cpu_critical_enter(); + savecrit = intr_disable(); /* * Interrupt handling (for another interrupt) may have pushed the @@ -789,7 +789,7 @@ npxtrap() GET_FPU_SW(curthread) &= ~0x80bf; else fnclex(); - cpu_critical_exit(savecrit); + intr_restore(savecrit); return (fpetable[status & ((~control & 0x3f) | 0x40)]); } @@ -804,7 +804,7 @@ int npxdna() { u_long *exstat; - critical_t s; + register_t s; if (!npx_exists) return (0); @@ -813,7 +813,7 @@ npxdna() PCPU_GET(fpcurthread), curthread); panic("npxdna"); } - s = cpu_critical_enter(); + s = intr_disable(); stop_emulating(); /* * Record new context early in case frstor causes an IRQ13. @@ -835,7 +835,7 @@ npxdna() * first FPU instruction after a context switch. */ fpurstor(&PCPU_GET(curpcb)->pcb_save); - cpu_critical_exit(s); + intr_restore(s); return (1); } |