summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-09-15 12:09:50 +0000
committerphk <phk@FreeBSD.org>2004-09-15 12:09:50 +0000
commit1795816cf766cbe770384eb50bb559e0d9fba2a6 (patch)
tree56e89a43c4b2e1186b0edeeb3e43382456e0543e /sys/alpha
parentfe0362c5d20c4b60c70d896778b722b144ded3ed (diff)
downloadFreeBSD-src-1795816cf766cbe770384eb50bb559e0d9fba2a6.zip
FreeBSD-src-1795816cf766cbe770384eb50bb559e0d9fba2a6.tar.gz
Add new a function isa_dma_init() which returns an errno when it fails
and which takes a M_WAITOK/M_NOWAIT flag argument. Add compatibility isa_dmainit() macro which whines loudly if isa_dma_init() fails. Problem uncovered by: tegge
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/isa/isa_dma.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/alpha/isa/isa_dma.c b/sys/alpha/isa/isa_dma.c
index 0c01fc5..91ca8bb 100644
--- a/sys/alpha/isa/isa_dma.c
+++ b/sys/alpha/isa/isa_dma.c
@@ -93,10 +93,8 @@ static int dmapageport[8] = { 0x87, 0x83, 0x81, 0x82, 0x8f, 0x8b, 0x89, 0x8a };
/*
* Setup a DMA channel's bounce buffer.
*/
-void
-isa_dmainit(chan, bouncebufsize)
- int chan;
- u_int bouncebufsize;
+int
+isa_dma_init(int chan, u_int bouncebufsize, int flag __unused)
{
static int initted = 0;
bus_addr_t boundary = chan >= 4 ? 0x20000 : 0x10000;
@@ -114,10 +112,10 @@ isa_dmainit(chan, bouncebufsize)
#ifdef DIAGNOSTIC
if (chan & ~VALID_DMA_MASK)
- panic("isa_dmainit: channel out of range");
+ panic("isa_dma_init: channel out of range");
if (dma_tag[chan] || dma_map[chan])
- panic("isa_dmainit: impossible request");
+ panic("isa_dma_init: impossible request");
#endif
if (bus_dma_tag_create(/*parent*/NULL,
@@ -132,13 +130,13 @@ isa_dmainit(chan, bouncebufsize)
/*lockfunc*/busdma_lock_mutex,
/*lockarg*/&Giant,
&dma_tag[chan]) != 0) {
- panic("isa_dmainit: unable to create dma tag\n");
+ panic("isa_dma_init: unable to create dma tag\n");
}
if (bus_dmamap_create(dma_tag[chan], 0, &dma_map[chan])) {
- panic("isa_dmainit: unable to create dma map\n");
+ panic("isa_dma_init: unable to create dma map\n");
}
-
+ return (0);
}
/*
@@ -349,7 +347,7 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
#endif
if (!dma_tag || !dma_map[chan])
- panic("isa_dmastart: called without isa_dmainit");
+ panic("isa_dmastart: called without isa_dma_init");
dma_busy |= (1 << chan);
OpenPOWER on IntegriCloud