摘要 |
A dynamic allocation method for DMA buffers. A DMA controller is directed to move data from an input/output (I/O) device to buffers linked in a buffer ring. Next, free buffers in the buffer ring are detected when the each buffer is full. At least one new buffer is then allocated to the buffer ring when the number of detected free buffers is less than a first threshold value. Further, at least one buffer is released from the buffer ring when the number of detected free buffers exceeds a second threshold value, wherein the second threshold value exceeds the first threshold value, and the free buffers are all buffers in the buffer ring excluding those with data moved thereto by the DMA controller not yet processed by the CPU.
|