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>CARD_SetCacheFlushThreshold</title>
8<link rel="stylesheet" href="../../css/nitro.css" type="text/css" />
9</head>
10
11<body>
12
13<h1 align="left">CARD_SetCacheFlushThreshold <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
14<H2>Syntax</H2>
15
16<dl>
17  <dd>
18<code>#include &lt;nitro/card.h&gt;</code><br />
19  <br />
20  <code>void CARD_SetCacheFlushThreshold(u32 icache, u32 dcache);</code><br />
21  <br />
22  </dd>
23</dl>
24<h2>Arguments</h2>
25<table border="1" width="100%">
26  <tbody>
27    <tr>
28<td width="13%"><SPAN class="argument">icache</SPAN></td>
29<td width="87%">The threshold value for invalidating the Instruction Cache</td>
30    </tr>
31    <tr>
32<td width="13%"><SPAN class="argument">dcache</SPAN></td>
33<td width="87%">The threshold value for invalidating the Data Cache</td>
34    </tr>
35  </tbody>
36</table>
37
38<h2>Return Values</h2>
39<p>None.</p>
40
41<h2>Description</h2>
42<p>
43Sets the threshold value for switching the method used to invalidate the cache when DMA transfer is required inside the library.
44</p>
45<p>
46If a small cache area is being invalidated, the <a href="../../os/cache/IC_InvalidateRange.html"><CODE>IC_InvalidateRange</CODE></a> and <a href="../../os/cache/DC_FlushRange.html"><CODE>DC_FlushRange</CODE></a> functions should be used to perform partial invalidations. However, this takes too much time on buffers larger than a certain size, so it is more effective to use the <a href="../../os/cache/IC_InvalidateAll.html"><CODE>IC_InvalidateAll</CODE></a> and <a href="../../os/cache/DC_FlushAll.html"><CODE>DC_FlushAll</CODE></a> functions to invalidate the entire cache. You can use this function to change the threshold value that defines when to switch the method used to invalidate the cache.
47</p>
48<p>
49When the CARD library is performing DMA transfers, it partially invalidates the cache if the transfer size is smaller than the value set here. Otherwise, it invalidates the entire cache. The default threshold value for <CODE>icache</CODE> is <CODE>0x400</CODE> (1 KB). The default for <CODE>dcache</CODE> is <CODE>0x2400</CODE> (9 KB). As a rule of thumb, these are good thresholds for most normal programs, but you are free to change the values if you think that the program structure and scenes warrant more appropriate values.<br />
50</p>
51<h2>See Also</h2>
52<p><a href="CARD_GetCacheFlushThreshold.html"><code>CARD_GetCacheFlushThreshold</code></a></p>
53
54<h2>Revision History</h2>
55<p>
562008/12/05 Changed the default values.<br />2007/05/16 Initial version.
57</p>
58<hr><p>CONFIDENTIAL</p></body>
59</html>
60