summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/dma.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-18 20:02:17 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-18 20:02:17 +0000
commitf5b15ebcd3edfa52a4c8eaa1ef2dd88a60196285 (patch)
tree2ea744f217e03d6761e3035e2223032bccfe8ca9 /sys/src/9/pc/dma.c
parentdf687d3840503e4811a5572bf5ce97b74cb21727 (diff)
dma: comment
Diffstat (limited to 'sys/src/9/pc/dma.c')
-rw-r--r--sys/src/9/pc/dma.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/9/pc/dma.c b/sys/src/9/pc/dma.c
index 4a81f516a..2370442e1 100644
--- a/sys/src/9/pc/dma.c
+++ b/sys/src/9/pc/dma.c
@@ -212,12 +212,15 @@ dmasetup(int chan, void *va, long len, int flags)
else
xp->len = 0;
+ mode = ((flags & DMAREAD) ? 0x44 : 0x48) | /* read or write */
+ ((flags & DMALOOP) ? 0x10 : 0) | /* auto init mode */
+ chan;
+
/*
* this setup must be atomic
*/
ilock(dp);
- mode = ((flags & DMAREAD) ? 0x44 : 0x48) | ((flags & DMALOOP) ? 0x10 : 0) | chan;
- outb(dp->mode, mode); /* single mode dma (give CPU a chance at mem) */
+ outb(dp->mode, mode);
outb(dp->page[chan], pa>>16);
outb(dp->cbp, 0); /* set count & address to their first byte */
outb(dp->addr[chan], pa>>dp->shift); /* set address */