summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/cbus_dma.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-03-13 10:19:32 +0000
committerphk <phk@FreeBSD.org>2000-03-13 10:19:32 +0000
commit8e89e2d03f02f781ce162589fb0704e91d884725 (patch)
treeeb66f0ed21705383ed2e06c5af45fa2f4b853b07 /sys/pc98/cbus/cbus_dma.c
parente435347f0c0b53e0efe099a854735af2a18d31cf (diff)
downloadFreeBSD-src-8e89e2d03f02f781ce162589fb0704e91d884725.zip
FreeBSD-src-8e89e2d03f02f781ce162589fb0704e91d884725.tar.gz
Stop isadma from abusing the B_READ, B_RAW and B_WRITE flags.
Define ISADMA_{READ,WRITE,RAW} macros with the same numeric values as the B_{READ,WRITE,RAW} and use them instead throughout.
Diffstat (limited to 'sys/pc98/cbus/cbus_dma.c')
-rw-r--r--sys/pc98/cbus/cbus_dma.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/sys/pc98/cbus/cbus_dma.c b/sys/pc98/cbus/cbus_dma.c
index 1866acd..e6f3f1a 100644
--- a/sys/pc98/cbus/cbus_dma.c
+++ b/sys/pc98/cbus/cbus_dma.c
@@ -53,7 +53,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/buf.h> /* B_READ and B_RAW */
#include <sys/malloc.h>
#ifdef PC98
#include <machine/md_var.h>
@@ -277,7 +276,7 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
newaddr = dma_bouncebuf[chan];
/* copy bounce buffer on write */
- if (!(flags & B_READ))
+ if (!(flags & ISADMA_READ))
bcopy(addr, newaddr, nbytes);
addr = newaddr;
}
@@ -285,7 +284,7 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
/* translate to physical */
phys = pmap_extract(pmap_kernel(), (vm_offset_t)addr);
- if (flags & B_RAW) {
+ if (flags & ISADMA_RAW) {
dma_auto_mode |= (1 << chan);
} else {
dma_auto_mode &= ~(1 << chan);
@@ -305,15 +304,15 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
#endif
/* set dma channel mode, and reset address ff */
- /* If B_RAW flag is set, then use autoinitialise mode */
- if (flags & B_RAW) {
- if (flags & B_READ)
+ /* If ISADMA_RAW flag is set, then use autoinitialise mode */
+ if (flags & ISADMA_RAW) {
+ if (flags & ISADMA_READ)
outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_WRITE|chan);
else
outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_READ|chan);
}
else
- if (flags & B_READ)
+ if (flags & ISADMA_READ)
outb(DMA1_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|chan);
else
outb(DMA1_MODE, DMA37MD_SINGLE|DMA37MD_READ|chan);
@@ -344,15 +343,15 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
*/
/* set dma channel mode, and reset address ff */
- /* If B_RAW flag is set, then use autoinitialise mode */
- if (flags & B_RAW) {
- if (flags & B_READ)
+ /* If ISADMA_RAW flag is set, then use autoinitialise mode */
+ if (flags & ISADMA_RAW) {
+ if (flags & ISADMA_READ)
outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_WRITE|(chan&3));
else
outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_READ|(chan&3));
}
else
- if (flags & B_READ)
+ if (flags & ISADMA_READ)
outb(DMA2_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|(chan&3));
else
outb(DMA2_MODE, DMA37MD_SINGLE|DMA37MD_READ|(chan&3));
@@ -379,7 +378,7 @@ void
isa_dmadone(int flags, caddr_t addr, int nbytes, int chan)
{
#ifdef PC98
- if (flags & B_READ) {
+ if (flags & ISADMA_READ) {
/* cache flush only after reading 92/12/9 by A.Kojima */
if (need_post_dma_flush)
invd();
@@ -408,7 +407,7 @@ isa_dmadone(int flags, caddr_t addr, int nbytes, int chan)
if (dma_bounced & (1 << chan)) {
/* copy bounce buffer on read */
- if (flags & B_READ)
+ if (flags & ISADMA_READ)
bcopy(dma_bouncebuf[chan], addr, nbytes);
dma_bounced &= ~(1 << chan);
OpenPOWER on IntegriCloud