MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / GetDmaResidue

Function GetDmaResidue

bsp/x86/drivers/dma.h:181–191  ·  view source on GitHub ↗

* 获得DMA 传输剩余块数 */

Source from the content-addressed store, hash-verified

179 * 获得DMA 传输剩余块数
180 */
181static __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

Callers

nothing calls this directly

Calls 1

inbFunction · 0.85

Tested by

no test coverage detected