summaryrefslogtreecommitdiffstats
path: root/sys/pc98
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-28 03:06:10 +0000
committerjhb <jhb@FreeBSD.org>2001-03-28 03:06:10 +0000
commit3e3a661612c8296ecbe74b7f3b09965dacbb7ff9 (patch)
tree31bcf682861c81d34d0528babee47b8a1d4c44ba /sys/pc98
parentdea228e37800fc07cb4619f31e155310a4bad233 (diff)
downloadFreeBSD-src-3e3a661612c8296ecbe74b7f3b09965dacbb7ff9.zip
FreeBSD-src-3e3a661612c8296ecbe74b7f3b09965dacbb7ff9.tar.gz
Switch from save/disable/restore_intr() to critical_enter/exit().
Diffstat (limited to 'sys/pc98')
-rw-r--r--sys/pc98/pc98/npx.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/sys/pc98/pc98/npx.c b/sys/pc98/pc98/npx.c
index c656736d..b04e008 100644
--- a/sys/pc98/pc98/npx.c
+++ b/sys/pc98/pc98/npx.c
@@ -239,7 +239,7 @@ npx_probe(dev)
#else /* SMP */
int result;
- u_long save_eflags;
+ critical_t savecrit;
u_char save_icu1_mask;
u_char save_icu2_mask;
struct gate_descriptor save_idt_npxintr;
@@ -258,8 +258,7 @@ npx_probe(dev)
npx_irq = 13;
#endif
npx_intrno = NRSVIDT + npx_irq;
- save_eflags = read_eflags();
- disable_intr();
+ savecrit = critcal_enter();
#ifdef PC98
save_icu1_mask = inb(IO_ICU1 + 2);
save_icu2_mask = inb(IO_ICU2 + 2);
@@ -285,9 +284,9 @@ npx_probe(dev)
* needs interrupts enabled. Does this make any difference
* here?
*/
- enable_intr();
+ critical_exit(savecrit);
result = npx_probe1(dev);
- disable_intr();
+ savecrit = critcal_enter();
#ifdef PC98
outb(IO_ICU1 + 2, save_icu1_mask);
outb(IO_ICU2 + 2, save_icu2_mask);
@@ -297,7 +296,7 @@ npx_probe(dev)
#endif
idt[npx_intrno] = save_idt_npxintr;
idt[16] = save_idt_npxtrap;
- write_eflags(save_eflags);
+ critical_exit(savecrit);
return (result);
#endif /* SMP */
@@ -852,7 +851,7 @@ npx_intr(dummy)
int
npxdna()
{
- int s;
+ critical_t s;
if (!npx_exists)
return (0);
@@ -861,8 +860,7 @@ npxdna()
PCPU_GET(npxproc), curproc);
panic("npxdna");
}
- s = save_intr();
- disable_intr();
+ s = critical_enter();
stop_emulating();
/*
* Record new context early in case frstor causes an IRQ13.
@@ -882,7 +880,7 @@ npxdna()
* first FPU instruction after a context switch.
*/
frstor(&PCPU_GET(curpcb)->pcb_savefpu);
- restore_intr(s);
+ critical_exit(s);
return (1);
}
@@ -909,15 +907,14 @@ npxsave(addr)
#else /* SMP */
- int intrstate;
+ critical_t savecrit;
u_char icu1_mask;
u_char icu2_mask;
u_char old_icu1_mask;
u_char old_icu2_mask;
struct gate_descriptor save_idt_npxintr;
- intrstate = save_intr();
- disable_intr();
+ savecrit = critcal_enter();
#ifdef PC98
old_icu1_mask = inb(IO_ICU1 + 2);
old_icu2_mask = inb(IO_ICU2 + 2);
@@ -934,13 +931,13 @@ npxsave(addr)
outb(IO_ICU2 + 1, old_icu2_mask & ~(npx0_imask >> 8));
#endif
idt[npx_intrno] = npx_idt_probeintr;
- write_eflags(intrstate);
+ critical_exit(savecrit);
stop_emulating();
fnsave(addr);
fnop();
start_emulating();
PCPU_SET(npxproc, NULL);
- disable_intr();
+ savecrit = critcal_enter();
#ifdef PC98
icu1_mask = inb(IO_ICU1 + 2); /* masks may have changed */
icu2_mask = inb(IO_ICU2 + 2);
@@ -959,7 +956,7 @@ npxsave(addr)
| (old_icu2_mask & (npx0_imask >> 8)));
#endif
idt[npx_intrno] = save_idt_npxintr;
- restore_intr(intrstate); /* back to previous state */
+ critical_exit(savecrit); /* back to previous state */
#endif /* SMP */
}
OpenPOWER on IntegriCloud