summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/isa.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1997-07-28 07:49:40 +0000
committermsmith <msmith@FreeBSD.org>1997-07-28 07:49:40 +0000
commita3e55966a073a41413c2b335a85d64c9d93c834f (patch)
treedddd2e0c36ff6fd451a709a187844097cdcd0941 /sys/i386/isa/isa.c
parentd22bd4cd5ef12575b5db2ed91ad9b34848d90066 (diff)
downloadFreeBSD-src-a3e55966a073a41413c2b335a85d64c9d93c834f.zip
FreeBSD-src-a3e55966a073a41413c2b335a85d64c9d93c834f.tar.gz
Use disable_intr() / read/write_eflags() to ensure that interrupt
handlers don't skew the results of isa_dmastatus. The function can be safely called with interrupts disabled. Submitted by: Stephen McKay <syssgm@dtir.qld.gov.au>
Diffstat (limited to 'sys/i386/isa/isa.c')
-rw-r--r--sys/i386/isa/isa.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index c51b59b..cc7f08d 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.95 1997/07/20 14:10:03 bde Exp $
+ * $Id: isa.c,v 1.96 1997/07/24 05:27:39 msmith Exp $
*/
/*
@@ -905,8 +905,9 @@ int
isa_dmastatus(int chan)
{
u_long cnt = 0;
- int ffport, waport, s;
+ int ffport, waport;
u_long low, high, low2, high2;
+ u_long ef;
/* channel active? */
if (dma_inuse & (1 << chan) == 0) {
@@ -927,14 +928,15 @@ isa_dmastatus(int chan)
waport = DMA2_CHN(chan - 4) + 2;
}
- s = splhigh(); /* no interrupts Mr Jones! */
+ ef = read_eflags(); /* get current flags */
+ disable_intr(); /* no interrupts Mr Jones! */
outb(ffport, 0); /* clear register LSB flipflop */
low = inb(waport);
high = inb(waport);
outb(ffport, 0); /* clear again (paranoia?) */
low2 = inb(waport);
high2 = inb(waport);
- splx(s);
+ write_eflags(ef); /* restore flags */
/* now decide if a wrap has tried to skew our results */
if (low >= low2) {
OpenPOWER on IntegriCloud