*/\r
void DMA_Install()\r
{\r
- int i;\r
+ Uint i;\r
for(i=8;i--;)\r
{\r
outb( cMASKPORT[i], 0x04 | (i & 0x3) ); // mask channel\r
\r
dma_channels[i].mode = 0;\r
dma_addresses[i] = (char*)DMA_ADDRESS(i);\r
- dma_addresses[i] += 0xC0000000;\r
+ dma_addresses[i] += KERNEL_BASE;\r
}\r
}\r
\r
/**\r
- * \fn void DMA_SetChannel(int channel, int length, int read)\r
+ * \fn void DMA_SetChannel(int Channel, int length, int read)\r
* \brief Set DMA Channel Length and RW\r
*/\r
-void DMA_SetChannel(int channel, int length, int read)\r
+void DMA_SetChannel(int Channel, int length, int read)\r
{\r
- channel &= 7;\r
- read = read && 1;\r
+ Uint chan = Channel & 7;\r
+ read = !!read;\r
if(length > DMA_SIZE) length = DMA_SIZE;\r
length --; //Adjust for DMA\r
//__asm__ __volatile__ ("cli");\r
- outb( cMASKPORT[channel], 0x04 | (channel & 0x3) ); // mask channel\r
- outb( cCLEARPORT[channel], 0x00 );\r
- outb( cMODEPORT[channel], (0x44 + (!read)*4) | (channel & 0x3) );\r
- outb( cADDRPORT[channel], LOWB(DMA_ADDRESS(channel)) ); // send address\r
- outb( cADDRPORT[channel], HIB(DMA_ADDRESS(channel)) ); // send address\r
- outb( cPAGEPORT[channel], HIW(DMA_ADDRESS(channel)) ); // send page\r
- outb( cCOUNTPORT[channel], LOWB(length) ); // send size\r
- outb( cCOUNTPORT[channel], HIB(length) ); // send size\r
- outb( cMASKPORT[channel], channel & 0x3 ); // unmask channel\r
- dma_addresses[channel] = (char*)DMA_ADDRESS(channel);\r
- dma_addresses[channel] += 0xC0000000;\r
+ outb( cMASKPORT[chan], 0x04 | (chan & 0x3) ); // mask channel\r
+ outb( cCLEARPORT[chan], 0x00 );\r
+ outb( cMODEPORT[chan], (0x44 + (!read)*4) | (chan & 0x3) );\r
+ outb( cADDRPORT[chan], LOWB(DMA_ADDRESS(chan)) ); // send address\r
+ outb( cADDRPORT[chan], HIB(DMA_ADDRESS(chan)) ); // send address\r
+ outb( cPAGEPORT[chan], HIW(DMA_ADDRESS(chan)) ); // send page\r
+ outb( cCOUNTPORT[chan], LOWB(length) ); // send size\r
+ outb( cCOUNTPORT[chan], HIB(length) ); // send size\r
+ outb( cMASKPORT[chan], chan & 0x3 ); // unmask channel\r
+ dma_addresses[chan] = (char*)DMA_ADDRESS(chan);\r
+ dma_addresses[chan] += KERNEL_BASE;\r
//__asm__ __volatile__ ("sti");\r
}\r
\r