* 获得DMA 传输剩余块数 */
| 179 | * 获得DMA 传输剩余块数 |
| 180 | */ |
| 181 | static __inline__ int GetDmaResidue(unsigned int dmanr) |
| 182 | { |
| 183 | unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE |
| 184 | : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE; |
| 185 | |
| 186 | /* using short to get 16-bit wrap around */ |
| 187 | unsigned short count; |
| 188 | count = 1 + inb(io_port); |
| 189 | count += inb(io_port) << 8; |
| 190 | return (dmanr<=3)? count : (count<<1); |
| 191 | } |
| 192 | |
| 193 | #endif |
| 194 |