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_CpuCopy</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">SVC_CpuCopy* <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/common/systemCall.h&gt;</CODE></PRE>
16  <PRE><CODE>#define SVC_CpuCopy( srcp, destp, size, bit );
17#define SVC_CpuCopyArray( srcp, destp, bit );
18#define SVC_CpuCopyFast( srcp, destp, size );
19#define SVC_CpuCopyArrayFast( srcp, 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>srcp</STRONG></EM></TD>
28<TD width="87%">Source address.</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 to transfer.</TD>
37    </TR>
38    <TR>
39<TD><EM><STRONG>bit</STRONG></EM></TD>
40<TD>Transfer 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>Uses system calls to copy memory through the CPU. Because the <CODE>SVC_CpuCopy*</CODE> functions are macros, if <SPAN class="argument">srcp</SPAN> and <SPAN class="argument">destp</SPAN> are pointers, the type is not restricted. The <SPAN class="argument">size</SPAN> is a <CODE>u32</CODE> value. The <SPAN class="argument">bit</SPAN> argument can take only a value of 16 or 32.</P>
48<P>The difference between these functions and the <A href="../mi/memory/MI_CpuCopy.html"><CODE>MI_CpuCopy*</CODE></A> functions is that because the <CODE>SVC_CpuCopy*</CODE> functions operate on system ROM, their operating frequency is half what it would be if operating on cache or TCM. However, if cache is enabled, the loop portion of these two sets of functions is identical and the only difference becomes the overhead of calling the SVC functions. The method of specifying arguments is also different. If it is possible to use either instruction in your code, it would probably be better to use the <A href="../mi/memory/MI_CpuCopy.html"><CODE>MI_CpuCopy*</CODE></A> functions instead of the <CODE>SVC_CpuCopy*</CODE> functions, unless you have a specific reason to do otherwise.</P>
49<P>The <CODE>SVC_CpuCopy</CODE> function copies <SPAN class="argument">size</SPAN> bytes of data from the address indicated by <SPAN class="argument">srcp</SPAN> to the address indicated by <SPAN class="argument">destp</SPAN>. When the transfer bits are set to 16, you must align <SPAN class="argument">srcp</SPAN> and <SPAN class="argument">destp</SPAN> to a 2-byte boundary; when the transfer bits are 32, you must align <SPAN class="argument">srcp</SPAN> and <SPAN class="argument">destp</SPAN> to a 4-byte boundary.</P>
50<P>The <CODE>SVC_CpuCopyArray</CODE> function is <CODE>SVC_CpuCopy</CODE> with its transfer size set to <CODE>sizeof(<SPAN class="argument">srcp</SPAN>)</CODE>. In other words, it is the same as the line below:<br /><CODE>SVC_CpuCopy( srcp, destp, sizeof(srcp), bit )</CODE></P>
51<P>The <CODE>SVC_CpuCopyFast</CODE> function quickly copies <SPAN class="argument">size</SPAN> bytes of data from the address indicated by <SPAN class="argument">srcp</SPAN> to the address indicated by <SPAN class="argument">destp</SPAN>. The copy size must be a multiple of 4. It copies quickly in units of 32 bytes and copies the remainder in units of 4 bytes. You must align <SPAN class="argument">srcp</SPAN> and <SPAN class="argument">destp</SPAN> to a 4-byte boundary.</P>
52<P>The <CODE>SVC_CpuCopyArrayFast</CODE> function is equivalent to <CODE>SVC_CpuCopyFast</CODE> with its transfer size set to <CODE>sizeof(<SPAN class="argument">srcp</SPAN>)</CODE>. In other words, it is the same as the line below:<br /><CODE>SVC_CpuCopyFast( srcp, destp, sizeof(srcp) ) </CODE></P>
53<H2>Internal Operation</H2>
54<P>Calls system call.</P>
55<H2>See Also</H2>
56<P><CODE><A href="../mi/memory/MI_CpuCopy.html">MI_CpuCopy*</a></code><BR><code><a href="../mi/dma/MI_DmaCopy.html">MI_DmaCopy*</a></code><BR><code><a href="SVC_CpuClear.html">SVC_CpuClear*</A></CODE></P>
57<H2>Revision History</H2>
58<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 calls are used. <BR>2004/01/18 Initial version.</P>
59<hr><p>CONFIDENTIAL</p></body>
60</HTML>