plan 9 kernel history: overview | file list | diff list

1999/0713/pc/dma.c (diff list | history)

1999/0713/sys/src/9/pc/dma.c:8,301999/0714/sys/src/9/pc/dma.c:8,13 (short | long | prev)
Use ioalloc.
rsc Fri Mar 4 12:44:25 2005
1991/0803    
typedef struct DMA	DMA; 
typedef struct DMAxfer	DMAxfer; 
 
enum 
{ 
	/* 
	 *  the byte registers for DMA0 are all one byte apart 
	 */ 
	Dma0=		0x00, 
	Dma0status=	Dma0+0x8,	/* status port */ 
	Dma0reset=	Dma0+0xD,	/* reset port */ 
                 
	/* 
	 *  the byte registers for DMA1 are all two bytes apart (why?) 
	 */ 
	Dma1=		0xC0, 
	Dma1status=	Dma1+2*0x8,	/* status port */ 
	Dma1reset=	Dma1+2*0xD,	/* reset port */ 
}; 
                 
/* 
 *  state of a dma transfer 
 */ 
1999/0713/sys/src/9/pc/dma.c:89,991999/0714/sys/src/9/pc/dma.c:72,86
1993/0915    
{ 
	DMA *dp; 
	DMAxfer *xp; 
1999/0714    
	static int once; 
1993/0915    
 
1999/0713    
	if(ioalloc(0x00, 0x10, 0) < 0 
	|| ioalloc(0x80, 0x10, 0) < 0 
	|| ioalloc(0xd0, 0x10, 0) < 0) 
		panic("dmainit"); 
1999/0714    
	if(once == 0){ 
		if(ioalloc(0x00, 0x10, 0, "dma") < 0 
		|| ioalloc(0x80, 0x10, 0, "dma") < 0 
		|| ioalloc(0xd0, 0x10, 0, "dma") < 0) 
			panic("dmainit"); 
		once = 1; 
	} 
1999/0713    
 
1999/0403    
	if(maxtransfer > 64*1024) 
		maxtransfer = 64*1024; 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)