1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>LCLoadData</title> 10</head> 11 12<body> 13 14<h1>LCLoadData</h1> 15 16 17<h2>C Specification</h2> 18 19<dl> 20<dd><pre><code>#include <revolution/os.h></code></pre> 21 </dd> 22<dd><pre><code>u32 LCLoadData(void* <em>destAddr</em>, void* <em>srcAddr</em>, u32 <em>nBytes</em>);</code></pre> 23 </dd> 24</dl> 25<H2>Arguments</H2> 26<TABLE border="1" cellpadding="3" cellspacing="0.1"> 27 <TBODY> 28 <TR> 29<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>destAddr</CODE></EM></STRONG></CODE></STRONG></EM></TD> 30<TD width="520">Start address for the locked cache region of the copy destination. Must be 32 byte-aligned.</TD> 31 </TR> 32 <TR> 33<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>srcAddr</CODE></EM></STRONG></CODE></STRONG></EM></TD> 34<TD width="520">Start address for data in main memory to copy to <CODE><EM><STRONG>destAddr</STRONG></EM></CODE>. Must be 32 byte-aligned.</TD> 35 </TR> 36 <TR> 37<TD width="120" bgcolor="#ffffe8"><STRONG><EM><CODE><STRONG><EM><CODE>nBytes</CODE></EM></STRONG></CODE></EM></STRONG></TD> 38<TD width="520">Transfer size. Must be 32 byte-aligned.</TD> 39 </TR> 40 </TBODY> 41</TABLE> 42<H2>Return Values</H2> 43<P>The number of transfers added to the DMA queue.</P> 44<h2>Description</h2> 45 46<p>Enqueues DMA transfers to load data into the locked cache at <code><em><strong>destAddr</strong></em></code> from main memory at <code><em><strong>srcAddr</strong></em></code>. The range of valid transfer destination addresses is the 16-KB region starting from the value returned by the <a href="LCGetBase.html"><code>LCGetBase</code></a> function. The number of transfers issued is returned as a return value.</p> 47 48<p>The only ways to determine if the transfers are complete are to poll the length of the DMA queue with the <code><a href="LCQueueLength.html">LCQueueLength</a></code> function or to wait until the queue length reaches a certain value with the <code><a href="LCQueueWait.html">LCQueueWait</a></code> function. See the <code><a href="LCStoreData.html">LCStoreData</a></code> function example in the Function Reference. </p> 49 50<p>The largest size that can be transferred with a single DMA transfer is 128 cache blocks (4 KB). Thus, the number of transfers added to the DMA queue is always CEILING (rounded up) (nBytes/4 KB). The <a href="LCLoadBlocks.html">LCLoadBlocks</a></code> function is a more efficient function that generates a single DMA transfer. However, it has no error checking and argument restrictions.</p> 51 52<p>A maximum of 15 outstanding DMA transfers in the DMA queue is allowed. If the queue overflows, a machine check exception occurs.</p> 53 54<p>The locked cache must be enabled, otherwise a machine check exception will occur during the DMA.</p> 55 56<p>If DMA finds destination addresses in the normal cache, a machine check exception will occur.</p> 57 58 59 60<h2>See Also</h2> 61 62<p><a href="../list.html#Cache" target="contents">Cache Functions</a>, <br> <code><a href="LCEnable.html">LCEnable</a>, <a href="LCStoreData.html">LCStoreData</a>, <a href="LCQueueLength.html">LCQueueLength</a>, <a href="LCQueueWait.html">LCQueueWait</a>, <a href="LCLoadBlocks.html">LCLoadBlocks</a></code></p> 63 64<h2>Revision History</h2> 65<P></P> 66<P>03/01/2006 Initial version.</p> 67</body> 68</html>