diff options
author | phk <phk@FreeBSD.org> | 2000-03-13 10:19:32 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-03-13 10:19:32 +0000 |
commit | 8e89e2d03f02f781ce162589fb0704e91d884725 (patch) | |
tree | eb66f0ed21705383ed2e06c5af45fa2f4b853b07 /sys/i386/isa/isa_dma.c | |
parent | e435347f0c0b53e0efe099a854735af2a18d31cf (diff) | |
download | FreeBSD-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/i386/isa/isa_dma.c')
-rw-r--r-- | sys/i386/isa/isa_dma.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/i386/isa/isa_dma.c b/sys/i386/isa/isa_dma.c index 698c6700..1cc1ea8 100644 --- a/sys/i386/isa/isa_dma.c +++ b/sys/i386/isa/isa_dma.c @@ -49,7 +49,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/buf.h> /* B_READ and B_RAW */ #include <sys/malloc.h> #include <vm/vm.h> #include <vm/vm_param.h> @@ -244,7 +243,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; } @@ -252,7 +251,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); @@ -265,15 +264,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(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); @@ -298,15 +297,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)); @@ -348,7 +347,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); |