#include <revolution/os.h> u32 LCLoadData(void* destAddr, void* srcAddr, u32 nBytes);
| destAddr | Start address for the locked cache region to be copied to. Must be 32-byte aligned. |
|---|---|
| srcAddr | Start address for data in main memory to be copied to destAddr. Must be 32-byte aligned. |
nBytes |
Transfer size. Must be 32-byte aligned. |
Returns the number of transactions added to the DMA queue.
Enqueues DMA transactions to load data to locked cache at destAddr from main memory at srcAddr. The range of valid destination addresses is the 16KB region starting at the value returned by the LCGetBase function. The number of transactions issued as return value is returned.
The only methods to determine whether a transaction has completed is either to poll the length of the DMA queue with the LCQueueLength function or to wait until the queue length reaches a fixed value with the LCQueueWait function. See the example in LCStoreData of the Function Reference.
The largest transfer possible with a single DMA transaction is 128 cache blocks (4KB). Thus, the number of transactions added (to the DMA queue) is always CEILING (rounded up) (nBytes/4KB). The LCLoadBlocks function is a more efficient function that generates a single DMA transaction, but imposes restrictions on its arguments and performs no error checking.
Note that a maximum of 15 DMA requests can be issued to the DMA queue. If the queue overflows, a machine check exception occurs.
The locked cache must be enabled, or else a machine check exception will occur during the DMA.
If DMA detects a destination address in normal cache, a machine check exception will occur.
Cache Functions, LCEnable, LCStoreData, LCQueueLength, LCQueueWait, LCLoadBlocks
2006/03/01 Initial version.
CONFIDENTIAL