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<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/os.h> 19 20u32 LCLoadData(void* destAddr, void* srcAddr, u32 nBytes); 21</pre></dd></dl> 22 23<H2>Arguments</H2> 24<TABLE class="arguments" border="1" > 25 <TBODY> 26 <TR> 27<TH>destAddr</TH> 28<TD>Start address for the locked cache region to be copied to. Must be 32-byte aligned.</TD> 29 </TR> 30 <TR> 31<TH>srcAddr</TH> 32<TD>Start address for data in main memory to be copied to <SPAN class="argument">destAddr</SPAN>. Must be 32-byte aligned.</TD> 33 </TR> 34 <TR> 35<TH><STRONG><EM><CODE>nBytes</CODE></EM></STRONG></TH> 36<TD>Transfer size. Must be 32-byte aligned.</TD> 37 </TR> 38 </TBODY> 39</TABLE> 40 41<H2>Return Values</H2> 42<P>Returns the number of transactions added to the DMA queue.</P> 43 44<h2>Description</h2> 45<p>Enqueues DMA transactions to load data to locked cache at <SPAN class="argument">destAddr</SPAN> from main memory at <SPAN class="argument">srcAddr</SPAN>. The range of valid destination addresses is the 16KB region starting at the value returned by the <A href="LCGetBase.html"><code>LCGetBase</code></A> function. The number of transactions issued as return value is returned.</p> 46 47<p>The only methods to determine whether a transaction has completed is either to poll the length of the DMA queue with the <A href="LCQueueLength.html"><code>LCQueueLength</code></A> function or to wait until the queue length reaches a fixed value with the <A href="LCQueueWait.html"><code>LCQueueWait</code></A> function. See the example in <A href="LCStoreData.html"><code>LCStoreData</code></A> of the Function Reference.</p> 48 49<p>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 <A href="LCLoadBlocks.html"><code>LCLoadBlocks</code></A> function is a more efficient function that generates a single DMA transaction, but imposes restrictions on its arguments and performs no error checking.</p> 50 51<p>Note that a maximum of 15 DMA requests can be issued to the DMA queue. If the queue overflows, a machine check exception occurs.</p> 52 53<p>The locked cache must be enabled, or else a machine check exception will occur during the DMA.</p> 54 55<p>If DMA detects a destination address in normal cache, a machine check exception will occur.</p> 56 57<h2>See Also</h2> 58<P class="reference"> 59<A href="../toc.html#Cache" target="contents">Cache Functions</A>, 60<a href="LCEnable.html">LCEnable</a>, 61<a href="LCStoreData.html">LCStoreData</a>, 62<a href="LCQueueLength.html">LCQueueLength</a>, 63<a href="LCQueueWait.html">LCQueueWait</a>, 64<a href="LCLoadBlocks.html">LCLoadBlocks</a> 65</p> 66 67<h2>Revision History</h2> 68<P> 692006/03/01 Initial version.<br> 70</p> 71 72<hr><p>CONFIDENTIAL</p></body> 73</html>