diff options
author | jhb <jhb@FreeBSD.org> | 2001-12-18 00:27:18 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-12-18 00:27:18 +0000 |
commit | a3b98398cbfb4b809f8577b6a95aabb2c30a1aeb (patch) | |
tree | bd1f842c61588e8478e798dece6dff8b2be41310 /sys/dev/sound/isa/mpu.c | |
parent | 090c933e94e7345e9c9e9a9fbe29ea6c8397a662 (diff) | |
download | FreeBSD-src-a3b98398cbfb4b809f8577b6a95aabb2c30a1aeb.zip FreeBSD-src-a3b98398cbfb4b809f8577b6a95aabb2c30a1aeb.tar.gz |
Modify the critical section API as follows:
- The MD functions critical_enter/exit are renamed to start with a cpu_
prefix.
- MI wrapper functions critical_enter/exit maintain a per-thread nesting
count and a per-thread critical section saved state set when entering
a critical section while at nesting level 0 and restored when exiting
to nesting level 0. This moves the saved state out of spin mutexes so
that interlocking spin mutexes works properly.
- Most low-level MD code that used critical_enter/exit now use
cpu_critical_enter/exit. MI code such as device drivers and spin
mutexes use the MI wrappers. Note that since the MI wrappers store
the state in the current thread, they do not have any return values or
arguments.
- mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is
assigned to curthread->td_savecrit during fork_exit().
Tested on: i386, alpha
Diffstat (limited to 'sys/dev/sound/isa/mpu.c')
-rw-r--r-- | sys/dev/sound/isa/mpu.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/sound/isa/mpu.c b/sys/dev/sound/isa/mpu.c index c0d305e..ed9b746 100644 --- a/sys/dev/sound/isa/mpu.c +++ b/sys/dev/sound/isa/mpu.c @@ -241,7 +241,6 @@ mpu_probe2(device_t dev) sc_p scp; int unit, i; intrmask_t irqp0, irqp1; - critical_t savecrit; scp = device_get_softc(dev); unit = device_get_unit(dev); @@ -267,7 +266,7 @@ mpu_probe2(device_t dev) * Idea-stolen-from: sys/isa/sio.c:sioprobe() */ - savecrit = critical_enter(); + critical_enter(); /* * See the initial irq. We have to do this now, @@ -279,7 +278,7 @@ mpu_probe2(device_t dev) /* Switch to uart mode. */ if (mpu_uartmode(scp) != 0) { - critical_exit(savecrit); + critical_exit(); printf("mpu%d: mode switching failed.\n", unit); mpu_releaseres(scp, dev); return (ENXIO); @@ -298,7 +297,7 @@ mpu_probe2(device_t dev) break; } if (irqp1 == irqp0) { - critical_exit(savecrit); + critical_exit(); printf("mpu%d: switching the mode gave no interrupt.\n", unit); mpu_releaseres(scp, dev); return (ENXIO); @@ -307,13 +306,13 @@ mpu_probe2(device_t dev) no_irq: /* Wait to see an ACK. */ if (mpu_waitack(scp) != 0) { - critical_exit(savecrit); + critical_exit(); printf("mpu%d: not acked.\n", unit); mpu_releaseres(scp, dev); return (ENXIO); } - critical_exit(savecrit); + critical_exit(); if (device_get_flags(dev) & MPU_DF_NO_IRQ) scp->irq_val = 0; |