| plan 9 kernel history: overview | file list | diff list |
1999/0506/alphapc/dma.c (diff list | history)
| 1999/0505/sys/src/9/alphapc/dma.c:3,9 – 1999/0506/sys/src/9/alphapc/dma.c:3,8 (short | long | prev | next) | ||
| 1999/0415 | #include "mem.h" #include "dat.h" #include "fns.h" | |
| 1999/0505/sys/src/9/alphapc/dma.c:63,68 – 1999/0506/sys/src/9/alphapc/dma.c:62,86 | ||
| 1999/0415 | 1 }, }; | |
| 1999/0506 | static void dmastatus(DMA *dp, int chan, char c) { int a, l, s; ilock(dp); outb(dp->cbp, 0); a = inb(dp->addr[chan]); a |= inb(dp->addr[chan])<<8; a |= inb(dp->page[chan])<<16; a |= inb(0x400|dp->page[chan])<<24; outb(dp->cbp, 0); l = inb(dp->count[chan]); l |= inb(dp->count[chan])<<8; s = inb(dp->cmd); iunlock(dp); print("%c: addr %uX len %uX stat %uX\n", c, a, l, s); } | |
| 1999/0415 | /* * DMA must be in the first 16MB. This gets called early by the * initialisation routines of any devices which require DMA to ensure | |
| 1999/0505/sys/src/9/alphapc/dma.c:73,79 – 1999/0506/sys/src/9/alphapc/dma.c:91,107 | ||
| 1999/0415 | { DMA *dp; DMAxfer *xp; | |
| 1999/0506 | static int once; | |
| 1999/0415 | ||
| 1999/0506 | if(once == 0){ outb(dma[0].mc, 0); outb(dma[1].mc, 0); outb(dma[0].cmask, 0); outb(dma[1].cmask, 0); outb(dma[1].mode, 0xC0); once = 1; } | |
| 1999/0423 | if(maxtransfer > 64*1024) maxtransfer = 64*1024; | |
| 1999/0505/sys/src/9/alphapc/dma.c:85,91 – 1999/0506/sys/src/9/alphapc/dma.c:113,119 | ||
| 1999/0423 | return 1; return 0; | |
| 1999/0415 | } | |
| 1999/0501 |
| |
| 1999/0506 | //dmastatus(dp, chan, 'I'); | |
| 1999/0423 | xp->bva = xspanalloc(maxtransfer, BY2PG, 64*1024); if(xp->bva == nil) | |
| 1999/0505/sys/src/9/alphapc/dma.c:107,131 – 1999/0506/sys/src/9/alphapc/dma.c:135,140 | ||
| 1999/0423 | return 0; | |
| 1999/0415 | } | |
| 1999/0504 |
| |
| 1999/0505 |
| |
| 1999/0504 |
| |
| 1999/0505 |
| |
| 1999/0504 |
| |
| 1999/0505/sys/src/9/alphapc/dma.c:159,164 – 1999/0506/sys/src/9/alphapc/dma.c:168,176 | ||
| 1999/0415 | chan = chan & 3; | |
| 1999/0501 | //print("va%lux+", va); #define tryPCI | |
| 1999/0506 | #ifndef PCIWADDR #define PCIWADDR(va) PADDR(va) #endif /* PCIWADDR */ | |
| 1999/0501 | #ifdef notdef | |
| 1999/0415 | xp = &dp->x[chan]; | |
| 1999/0505/sys/src/9/alphapc/dma.c:209,215 – 1999/0506/sys/src/9/alphapc/dma.c:221,227 | ||
| 1999/0415 | outb(dp->count[chan], ((len>>dp->shift)-1)>>8); outb(dp->sbm, chan); /* enable the channel */ iunlock(dp); | |
| 1999/0505 |
| |
| 1999/0506 | //dmastatus(dp, chan, 'S'); | |
| 1999/0415 | return len; } | |
| 1999/0505/sys/src/9/alphapc/dma.c:241,247 – 1999/0506/sys/src/9/alphapc/dma.c:253,259 | ||
| 1999/0415 | dp = &dma[(chan>>2)&1]; chan = chan & 3; | |
| 1999/0505 |
| |
| 1999/0506 | //dmastatus(dp, chan, 'E'); | |
| 1999/0415 | /* * disable the channel */ | |