summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-03-02 23:02:49 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-03-02 23:02:49 +0000
commit4515ca5e79743ddbbb7bf94f39b1d43c60e217b2 (patch)
treeadb5b4b7f2a7e0e3b78ff453902d4981082f3b4d /sys/dev/isa
parent210c68c7bd12bd5969b7b53aeacbbc428bebdf1b (diff)
protect more reads and rights^Wwrites w/ spl; avoid inline which blows the code in twice
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/ad1848.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/isa/ad1848.c b/sys/dev/isa/ad1848.c
index 51a98d3ae7b..00154581b1d 100644
--- a/sys/dev/isa/ad1848.c
+++ b/sys/dev/isa/ad1848.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ad1848.c,v 1.19 1999/07/29 09:45:04 niklas Exp $ */
+/* $OpenBSD: ad1848.c,v 1.20 2000/03/02 23:02:48 mickey Exp $ */
/* $NetBSD: ad1848.c,v 1.45 1998/01/30 02:02:38 augustss Exp $ */
/*
@@ -151,7 +151,7 @@ int ad1848_set_speed __P((struct ad1848_softc *, u_long *));
void ad1848_mute_monitor __P((void *, int));
static int ad_read __P((struct ad1848_softc *, int));
-static __inline void ad_write __P((struct ad1848_softc *, int, int));
+static void ad_write __P((struct ad1848_softc *, int, int));
static void ad_set_MCE __P((struct ad1848_softc *, int));
static void wait_for_calibration __P((struct ad1848_softc *));
@@ -163,23 +163,27 @@ ad_read(sc, reg)
struct ad1848_softc *sc;
int reg;
{
- int x;
+ int x, s;
+ s = splaudio();
ADWRITE(sc, AD1848_IADDR, (reg & 0xff) | sc->MCE_bit);
x = ADREAD(sc, AD1848_IDATA);
+ splx(s);
/* printf("(%02x<-%02x) ", reg|sc->MCE_bit, x); */
return x;
}
-static __inline void
+static void
ad_write(sc, reg, data)
struct ad1848_softc *sc;
int reg;
int data;
{
+ int s = splaudio();
ADWRITE(sc, AD1848_IADDR, (reg & 0xff) | sc->MCE_bit);
ADWRITE(sc, AD1848_IDATA, data & 0xff);
+ splx(s);
/* printf("(%02x->%02x) ", reg|sc->MCE_bit, data); */
}