diff options
author | phk <phk@FreeBSD.org> | 2004-09-15 12:09:50 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-09-15 12:09:50 +0000 |
commit | 1795816cf766cbe770384eb50bb559e0d9fba2a6 (patch) | |
tree | 56e89a43c4b2e1186b0edeeb3e43382456e0543e /sys/ia64/isa | |
parent | fe0362c5d20c4b60c70d896778b722b144ded3ed (diff) | |
download | FreeBSD-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/ia64/isa')
-rw-r--r-- | sys/ia64/isa/isa_dma.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/ia64/isa/isa_dma.c b/sys/ia64/isa/isa_dma.c index cd7fd69..08ead75 100644 --- a/sys/ia64/isa/isa_dma.c +++ b/sys/ia64/isa/isa_dma.c @@ -91,10 +91,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; @@ -112,10 +110,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, @@ -130,13 +128,14 @@ 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); } /* @@ -351,7 +350,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); |