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 | |
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.
-rw-r--r-- | sys/alpha/isa/isa_dma.c | 19 | ||||
-rw-r--r-- | sys/amd64/isa/isa_dma.c | 23 | ||||
-rw-r--r-- | sys/amd64/isa/isa_dma.h | 5 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb.c | 4 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb16.c | 4 | ||||
-rw-r--r-- | sys/dev/sound/isa/sb8.c | 4 | ||||
-rw-r--r-- | sys/dev/sound/pcm/channel.c | 6 | ||||
-rw-r--r-- | sys/i386/isa/asc.c | 6 | ||||
-rw-r--r-- | sys/i386/isa/gsc.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/isa_compat.h | 2 | ||||
-rw-r--r-- | sys/i386/isa/isa_dma.c | 23 | ||||
-rw-r--r-- | sys/i386/isa/isa_dma.h | 5 | ||||
-rw-r--r-- | sys/i386/isa/sound/dmabuf.c | 5 | ||||
-rw-r--r-- | sys/i386/isa/wt.c | 10 | ||||
-rw-r--r-- | sys/isa/isavar.h | 3 | ||||
-rw-r--r-- | sys/pc98/cbus/cbus_dma.c | 25 | ||||
-rw-r--r-- | sys/pc98/pc98/isa_dma.c | 25 |
17 files changed, 91 insertions, 82 deletions
diff --git a/sys/alpha/isa/isa_dma.c b/sys/alpha/isa/isa_dma.c index 4fcdc6b..8b5e64b 100644 --- a/sys/alpha/isa/isa_dma.c +++ b/sys/alpha/isa/isa_dma.c @@ -50,7 +50,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/buf.h> /* B_READ and B_RAW */ #include <sys/malloc.h> #include <sys/bus.h> #include <vm/vm.h> @@ -243,15 +242,15 @@ static void isa_dmastart_cb(void *arg, bus_dma_segment_t *segs, int nseg, */ /* 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); @@ -276,15 +275,15 @@ static void isa_dmastart_cb(void *arg, bus_dma_segment_t *segs, int nseg, */ /* 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)); @@ -338,7 +337,7 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) dma_busy |= (1 << chan); - if (flags & B_RAW) { + if (flags & ISADMA_RAW) { dma_auto_mode |= (1 << chan); } else { dma_auto_mode &= ~(1 << chan); diff --git a/sys/amd64/isa/isa_dma.c b/sys/amd64/isa/isa_dma.c index 698c6700..1cc1ea8 100644 --- a/sys/amd64/isa/isa_dma.c +++ b/sys/amd64/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); diff --git a/sys/amd64/isa/isa_dma.h b/sys/amd64/isa/isa_dma.h index 7f9396a..60a69bf 100644 --- a/sys/amd64/isa/isa_dma.h +++ b/sys/amd64/isa/isa_dma.h @@ -38,6 +38,11 @@ #define _I386_ISA_ISA_DMA_H_ #ifdef _KERNEL + +#define ISADMA_READ 0x00100000 +#define ISADMA_WRITE 0 +#define ISADMA_RAW 0x00080000 + void isa_dmacascade __P((int chan)); void isa_dmadone __P((int flags, caddr_t addr, int nbytes, int chan)); void isa_dmainit __P((int chan, u_int bouncebufsize)); diff --git a/sys/dev/sound/isa/sb.c b/sys/dev/sound/isa/sb.c index 2161982..5bfce34 100644 --- a/sys/dev/sound/isa/sb.c +++ b/sys/dev/sound/isa/sb.c @@ -456,8 +456,8 @@ sb16_swap(void *v, int dir) t = sb->pch.buffer->chan; sb->pch.buffer->chan = sb->rch.buffer->chan; sb->rch.buffer->chan = t; - sb->pch.buffer->dir = B_WRITE; - sb->rch.buffer->dir = B_READ; + sb->pch.buffer->dir = ISADMA_WRITE; + sb->rch.buffer->dir = ISADMA_READ; } } } diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index 2161982..5bfce34 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -456,8 +456,8 @@ sb16_swap(void *v, int dir) t = sb->pch.buffer->chan; sb->pch.buffer->chan = sb->rch.buffer->chan; sb->rch.buffer->chan = t; - sb->pch.buffer->dir = B_WRITE; - sb->rch.buffer->dir = B_READ; + sb->pch.buffer->dir = ISADMA_WRITE; + sb->rch.buffer->dir = ISADMA_READ; } } } diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index 2161982..5bfce34 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -456,8 +456,8 @@ sb16_swap(void *v, int dir) t = sb->pch.buffer->chan; sb->pch.buffer->chan = sb->rch.buffer->chan; sb->rch.buffer->chan = t; - sb->pch.buffer->dir = B_WRITE; - sb->rch.buffer->dir = B_READ; + sb->pch.buffer->dir = ISADMA_WRITE; + sb->rch.buffer->dir = ISADMA_READ; } } } diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 5be37fd..2188068 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -840,14 +840,14 @@ buf_isadma(snd_dbuf *b, int go) switch (go) { case PCMTRIG_START: DEB(printf("buf 0x%p ISA DMA started\n", b)); - isa_dmastart(b->dir | B_RAW, b->buf, + isa_dmastart(b->dir | ISADMA_RAW, b->buf, b->bufsize, b->chan); break; case PCMTRIG_STOP: case PCMTRIG_ABORT: DEB(printf("buf 0x%p ISA DMA stopped\n", b)); isa_dmastop(b->chan); - isa_dmadone(b->dir | B_RAW, b->buf, b->bufsize, + isa_dmadone(b->dir | ISADMA_RAW, b->buf, b->bufsize, b->chan); break; } @@ -1050,7 +1050,7 @@ chn_setdir(pcm_channel *c, int dir) c->direction = dir; r = c->setdir(c->devinfo, c->direction); if (!r && ISA_DMA(&c->buffer)) - c->buffer.dir = (dir == PCMDIR_PLAY)? B_WRITE : B_READ; + c->buffer.dir = (dir == PCMDIR_PLAY)? ISADMA_WRITE : ISADMA_READ; return r; } diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c index a819cdd..8c1e710 100644 --- a/sys/i386/isa/asc.c +++ b/sys/i386/isa/asc.c @@ -299,7 +299,7 @@ dma_restart(struct asc_unit *scu) unsigned char al=scu->cmd_byte; if (geomtab[scu->geometry].g_res==0) {/* color */ - isa_dmastart(B_READ, scu->sbuf.base+scu->sbuf.wptr, + isa_dmastart(ISADMA_READ, scu->sbuf.base+scu->sbuf.wptr, scu->linesize + 90 /* XXX */ , scu->dma_num); /* * looks like we have to set and then clear this @@ -312,7 +312,7 @@ dma_restart(struct asc_unit *scu) outb( ASC_CMD, al &= 0xfb ); scu->cmd_byte = al; } else { /* normal */ - isa_dmastart(B_READ, scu->sbuf.base+scu->sbuf.wptr, + isa_dmastart(ISADMA_READ, scu->sbuf.base+scu->sbuf.wptr, scu->linesize, scu->dma_num); /*** this is done in sub_20, after dmastart ? ***/ #if 0 @@ -513,7 +513,7 @@ ascintr(int unit) outb( ASC_CMD, ASC_STANDBY); scu->flags &= ~DMA_ACTIVE; /* bounce buffers... */ - isa_dmadone(B_READ, scu->sbuf.base+scu->sbuf.wptr, + isa_dmadone(ISADMA_READ, scu->sbuf.base+scu->sbuf.wptr, scu->linesize, scu->dma_num); scu->sbuf.wptr += scu->linesize; if (scu->sbuf.wptr >= scu->sbuf.size) scu->sbuf.wptr=0; diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c index 7762676..9eb15de 100644 --- a/sys/i386/isa/gsc.c +++ b/sys/i386/isa/gsc.c @@ -327,7 +327,7 @@ buffer_read(struct gsc_unit *scu) outb( scu->clrp, 0 ); stb = inb( scu->stat ); - isa_dmastart(B_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); + isa_dmastart(ISADMA_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); chan_bit = 0x01 << scu->channel; @@ -347,7 +347,7 @@ buffer_read(struct gsc_unit *scu) break; } splx(sps); - isa_dmadone(B_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); + isa_dmadone(ISADMA_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); outb( scu->clrp, 0 ); if(res != SUCCESS) diff --git a/sys/i386/isa/isa_compat.h b/sys/i386/isa/isa_compat.h index d976839..30c96fd 100644 --- a/sys/i386/isa/isa_compat.h +++ b/sys/i386/isa/isa_compat.h @@ -194,7 +194,7 @@ static struct old_isa_driver old_drivers[] = { { INTR_TYPE_TTY, &stlidriver }, #endif #if NLORAN > 0 - { INTR_TYPE_TTY, &lorandriver }, + { INTR_TYPE_TTY | INTR_TYPE_FAST, &lorandriver }, #endif /* BIO */ 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); diff --git a/sys/i386/isa/isa_dma.h b/sys/i386/isa/isa_dma.h index 7f9396a..60a69bf 100644 --- a/sys/i386/isa/isa_dma.h +++ b/sys/i386/isa/isa_dma.h @@ -38,6 +38,11 @@ #define _I386_ISA_ISA_DMA_H_ #ifdef _KERNEL + +#define ISADMA_READ 0x00100000 +#define ISADMA_WRITE 0 +#define ISADMA_RAW 0x00080000 + void isa_dmacascade __P((int chan)); void isa_dmadone __P((int flags, caddr_t addr, int nbytes, int chan)); void isa_dmainit __P((int chan, u_int bouncebufsize)); diff --git a/sys/i386/isa/sound/dmabuf.c b/sys/i386/isa/sound/dmabuf.c index 81d23de..383793d 100644 --- a/sys/i386/isa/sound/dmabuf.c +++ b/sys/i386/isa/sound/dmabuf.c @@ -25,6 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ #include <i386/isa/sound/sound_config.h> @@ -1103,14 +1104,14 @@ DMAbuf_start_dma(int dev, u_long physaddr, int count, int dma_mode) #ifndef PSEUDO_DMA_AUTOINIT if (audio_devs[dev]->flags & DMA_AUTOMODE) { /* Auto restart mode. Transfer the whole buffer */ - isa_dmastart(B_RAW | ((dma_mode == 0) ? B_READ : B_WRITE), + isa_dmastart(ISADMA_RAW | ((dma_mode == 0) ? ISADMA_READ : ISADMA_WRITE), (caddr_t) (void *) (uintptr_t) dmap->raw_buf_phys, dmap->bytes_in_use, chan); } else #endif { - isa_dmastart((dma_mode == 0) ? B_READ : B_WRITE, + isa_dmastart((dma_mode == 0) ? ISADMA_READ : ISADMA_WRITE, (caddr_t) (void *) (uintptr_t) physaddr, count, chan); } return count; diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c index 4f9d176..1a1c691 100644 --- a/sys/i386/isa/wt.c +++ b/sys/i386/isa/wt.c @@ -148,7 +148,7 @@ typedef struct { void *dmavaddr; /* virtual address of dma i/o buffer */ unsigned dmatotal; /* size of i/o buffer */ - unsigned dmaflags; /* i/o direction, B_READ or B_WRITE */ + unsigned dmaflags; /* i/o direction, ISADMA_READ or ISADMA_WRITE */ unsigned dmacount; /* resulting length of dma i/o */ wtstatus_t error; /* status of controller */ @@ -566,7 +566,7 @@ wtstrategy (struct buf *bp) t->flags &= ~TPEXCEP; s = splbio (); - if (wtstart (t, bp->b_flags, bp->b_data, bp->b_bcount)) { + if (wtstart (t, bp->b_flags & B_READ ? ISADMA_READ : ISADMA_WRITE, bp->b_data, bp->b_bcount)) { wtwait (t, 0, (bp->b_flags & B_READ) ? "wtread" : "wtwrite"); bp->b_resid -= t->dmacount; } @@ -637,7 +637,7 @@ wtintr (int u) /* * Clean up dma. */ - if ((t->dmaflags & B_READ) && (t->dmatotal - t->dmacount) < t->bsize) { + if ((t->dmaflags & ISADMA_READ) && (t->dmatotal - t->dmacount) < t->bsize) { /* If reading short block, copy the internal buffer * to the user memory. */ isa_dmadone (t->dmaflags, t->buf, t->bsize, t->chan); @@ -654,7 +654,7 @@ wtintr (int u) */ if (! (s & t->NOEXCEP)) { TRACE (("i/o exception\n")); - wtsense (t, 1, (t->dmaflags & B_READ) ? TP_WRP : 0); + wtsense (t, 1, (t->dmaflags & ISADMA_READ) ? TP_WRP : 0); if (t->error.err & (TP_EOM | TP_FIL)) t->flags |= TPVOL; /* end of file */ else @@ -801,7 +801,7 @@ wtdma (wtinfo_t *t) if (t->type == ARCHIVE) outb (t->SDMAPORT, 0); /* set dma */ - if ((t->dmaflags & B_READ) && (t->dmatotal - t->dmacount) < t->bsize) + if ((t->dmaflags & ISADMA_READ) && (t->dmatotal - t->dmacount) < t->bsize) /* Reading short block. Do it through the internal buffer. */ isa_dmastart (t->dmaflags, t->buf, t->bsize, t->chan); else diff --git a/sys/isa/isavar.h b/sys/isa/isavar.h index 34c81b4..d8d6f1d 100644 --- a/sys/isa/isavar.h +++ b/sys/isa/isavar.h @@ -54,6 +54,9 @@ typedef void isa_config_cb(void *arg, struct isa_config *config, int enable); #define ISA_NIRQ 2 #define ISA_NDRQ 2 +#define ISADMA_READ 0x00100000 +#define ISADMA_WRITE 0 +#define ISADMA_RAW 0x00080000 /* * Plug and play cards can support a range of resource * configurations. This structure is used by the isapnp parser to 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); diff --git a/sys/pc98/pc98/isa_dma.c b/sys/pc98/pc98/isa_dma.c index 1866acd..e6f3f1a 100644 --- a/sys/pc98/pc98/isa_dma.c +++ b/sys/pc98/pc98/isa_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); |