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>SVC_CpuClear*</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">SVC_CpuClear* <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 <nitro/os/common/systemCall.h></CODE></PRE> 16 <PRE><CODE>SVC_CpuClear( data, destp, size, bit ); 17SVC_CpuClearArray( data, destp, bit ); 18SVC_CpuClearFast( data, destp, size ); 19SVC_CpuClearArrayFast( data, destp );</CODE> 20 21(These are macros.)</PRE> 22</DL> 23<H2>Arguments</H2> 24<TABLE border="1" width="100%"> 25 <TBODY> 26 <TR> 27 <TD width="13%"><EM><STRONG>data</STRONG></EM></TD> 28 <TD width="87%">Clear data</TD> 29 </TR> 30 <TR> 31 <TD width="13%"><EM><STRONG>destp</STRONG></EM></TD> 32 <TD width="87%">destination address</TD> 33 </TR> 34 <TR> 35 <TD><EM><STRONG>size</STRONG></EM></TD> 36 <TD>number of bytes transferred</TD> 37 </TR> 38 <TR> 39 <TD><EM><STRONG>bit</STRONG></EM></TD> 40 <TD>Transmit bit width (16 or 32)</TD> 41 </TR> 42 </TBODY> 43</TABLE> 44<H2>Return Values</H2> 45<P>None.</P> 46<H2>Description</H2> 47<P>This function uses the CPU to perform memory clear. The <CODE>MI_CpuClear*()</CODE> function filled the memory with 0s. However the <CODE>SVC_CpuClear*()</CODE> function fills the memory with a specified value.</P> 48<P>Because <code>SVC_CpuClear*()</code> is a macro, if <EM><STRONG><CODE>destp</CODE></STRONG></EM> is a pointer, the type will not be limited. The <EM><STRONG><CODE>size</CODE></STRONG></EM> is in <CODE>u32</CODE> format. Only 16 or 32 bits can be specified. Specify <EM><STRONG><CODE>data</CODE></STRONG></EM> as clear data (data to fill the memory). When <EM><STRONG><CODE>bit</CODE></STRONG></EM> is 16, specify a <CODE>u16</CODE> value; when <EM><STRONG><CODE>bit</CODE></STRONG></EM> is 32, specify a <CODE>u32</CODE> value.</P> 49<P>The difference from <CODE><A href="../mi/memory/MI_CpuClear.html">MI_CpuClear*()</A></CODE> and <CODE><A href="../mi/memory/MI_CpuFill.html">MI_CpuFill*()</A></CODE> is that because <CODE>SVC_CpuClear*()</CODE> operates with system ROM, it operates with half the frequency of operating with cache or TCM. However, if the cache is valid, there is no difference with the loop, and the difference will be the generation of overhead for calling SVC function. As is mentioned above, the method of specifying argument is different, and the method of specifying values to fill memory is different. If your code can be written with either function, it is better to use <CODE><A href="../mi/memory/MI_CpuClear.html">MI_CpuClear*()</A></CODE> and <CODE><A href="../mi/memory/MI_CpuFill.html">MI_CpuFill*()</A></CODE> instead of <CODE>SVC_CpuClear*()</CODE> unless there is a specific reason not to.</P> 50<P><CODE>SVC_CpuClear()</CODE> writes <EM><STRONG><CODE>size</CODE></STRONG></EM> bytes of the data shown by <EM><STRONG><CODE>data</CODE></STRONG></EM>, starting from the address shown by <EM><STRONG><CODE>destp</CODE></STRONG></EM>. When the transmit bit is set to 16, you must align <EM><STRONG><CODE>destp</CODE></STRONG></EM> to a 2-byte boundary; when the transmit bit is 32 you must align <EM><STRONG><CODE>destp</CODE></STRONG></EM> to a 4-byte boundary.</P> 51<P><CODE>SVC_CpuClearArray()</CODE> is <CODE>SVC_CpuClear()</CODE> with the transmit size set to <CODE>sizeof( </CODE><EM><STRONG><CODE>destp</CODE></STRONG></EM> <CODE>)</CODE>. In other words, it is the same as <CODE>SVC_CpuClear( </CODE><EM><STRONG><CODE>data</CODE></STRONG></EM><CODE>, </CODE><EM><STRONG><CODE>destp</CODE></STRONG></EM><CODE>, sizeof(</CODE><EM><STRONG><CODE>destp</CODE></STRONG></EM><CODE>), </CODE><EM><STRONG><CODE>bit</CODE></STRONG></EM><CODE> )</CODE>.</P> 52<P><CODE>SVC_CpuClearFast()</CODE> quickly writes <EM><STRONG><CODE>size</CODE></STRONG></EM> bytes of the data shown by <EM><STRONG><CODE>data</CODE></STRONG></EM>, starting from the address shown by <EM><STRONG><CODE>destp</CODE></STRONG></EM>. The writing size must be a multiple of 4. It quickly writes in units of 32 bytes and the remainder is in units of 4 bytes. You must align <EM><STRONG><CODE>destp</CODE></STRONG></EM> to a 4-byte boundary.</P> 53<P><CODE>SVC_CpuClearArrayFast()</CODE> is <CODE>SVC_CpuClearFast()</CODE> with the transmit size set to <CODE>sizeof( </CODE><EM><STRONG><CODE>destp</CODE></STRONG></EM> <CODE>)</CODE>. In other words, it is the same as <CODE>SVC_CpuClearFast( </CODE><EM><STRONG><CODE>data</CODE></STRONG></EM><CODE> ,</CODE><EM><STRONG><CODE>destp</CODE></STRONG></EM><CODE>, sizeof(</CODE><EM><STRONG><CODE>destp</CODE></STRONG></EM><CODE>)</CODE>.</P> 54<H2>Internal Operation</H2> 55<P>Calls system call.</P> 56<H2>See Also</H2> 57<P><CODE><A href="../mi/memory/MI_CpuClear.html">MI_CpuClear*</A>, <A href="../mi/memory/MI_CpuFill.html">MI_CpuFill*</A>, <A href="../mi/dma/MI_DmaClear.html">MI_DmaClear*</A>, <A href="SVC_CpuCopy.html">SVC_CpuCopy*</A></CODE></P> 58<H2>Revision History</H2> 59<P>2004/07/20 Changed the condition for the transfer size of <code>SVC_CpuClearFast()</code> from a multiple of 32 bytes to a multiple of 4 bytes.<br>2004/03/29 Indicated that system call is used.<BR> 2004/01/18 Initial version.</P> 60<hr><p>CONFIDENTIAL</p></body> 61</HTML>