1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>DC_StoreRange</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">DC_StoreRange <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <PRE><CODE>#include &lt;nitro/os.h&gt;</CODE></PRE>
16  <PRE><CODE>void DC_StoreRange( const void* startAddr, u32 nBytes );
17
18void DC_CleanRange( const void* startAddr, u32 nBytes );</CODE></PRE>
19</DL>
20<H2>Arguments</H2>
21<TABLE border="1" width="100%">
22  <TBODY>
23    <TR>
24      <TD width="13%"><EM><STRONG>startAddr</STRONG></EM></TD>
25      <TD width="87%">Lowest address in the range to be cleaned</TD>
26    </TR>
27    <TR>
28      <TD width="13%"><EM><STRONG>nBytes</STRONG></EM></TD>
29      <TD width="87%">Number of bytes of the range to be cleaned</TD>
30    </TR>
31  </TBODY>
32</TABLE>
33<H2>Return Values</H2>
34<P>None.</P>
35<H2>Description</H2>
36<P>This function stores the specified region of data cache to memory.</P>
37<P>Specifically, it performs a cache writeback in a dirty state (state when a write to data cache corresponding to a specified memory region is not reflected in main memory) and places it in an clean state (state where all stored values in cache match memory contents).</P>
38<P>Call this function when completing data transmission data blocks that use the main memory of other devices, such as when performing DMA transfers or creating graphics commands.</P>
39<P><B><I>startAddr</I></B> is rounded down to the closest 32-byte boundary. The sum of <B><I>startAddr</I></B> + <B><I>nBytes</I></B> is rounded up to the closest 32-byte boundary.</P>
40<P><CODE>DC_CleanRange()</CODE> is another name for <CODE>DC_StoreRange()</CODE> and operates exactly the same way.  <BR><code>DC_Clean*/DC_CleanAndInvalidate*</code> were prepared for porting from the prototype SDK version. In most cases, use <code>DC_Store*/DC_Flush*</code>.</P>
41<P><BR> <B>Note</B></P>
42<P>The official documentation for the ARM processor sometimes describes <strong>Flush</strong> as the operation that invalidates the data cache, <strong>Clean</strong> as the operation that writes back the data cache and puts it into a clean state, and <strong>Clean and Flush</strong> as the operation that writes back and then invalidates. However, this SDK follows the conventions of the Nintendo&nbsp;GameCube and Nintendo64 by using <strong>Invalidate</strong> for invalidation, <strong>Store</strong> for writeback, and <strong>Flush</strong> for writeback and invalidate operations. &nbsp;</P>
43<H2>Internal Operation</H2>
44<P>Operates register 7 of the system control coprocessor.</P>
45<P>This function divides the specified region into cache-line units and repeats its operation over and over. Thus the amount of time it takes is proportional to the size of the region. If the region is large and the system is in a state where it can successfully manage the cache for the entire application, calling <A href="DC_StoreAll.html"><CODE>DC_StoreAll()</CODE></A> will require less processing time.</P>
46<H2>See Also</H2>
47<P><CODE><A href="DC_InvalidateAll.html">DC_InvalidateAll</A>, <A href="DC_StoreAll.html">DC_StoreAll</A>, <A href="DC_FlushAll.html">DC_FlushAll</A><BR></CODE><CODE><A href="DC_InvalidateRange.html">DC_InvalidateRange</A>, <A href="DC_FlushRange.html">DC_FlushRange</A></CODE></P>
48<H2>Revision History</H2>
49<P>2005/11/14 Changed the type of <em><strong><code>startAddr</code></strong></em> to <code>const void*</code>.<br> 2005/04/19 Added a description of the reason why processing time is proportional to the size of the memory region. <br>2003/12/22 Initial version.</P>
50<hr><p>CONFIDENTIAL</p></body>
51</HTML>