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>SVC_CpuCopy( srcp, destp, size, bit );
17SVC_CpuCopyArray( srcp, destp, bit );
18SVC_CpuCopyFast( srcp, destp, size );
19SVC_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 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>Uses the CPU to perform memory copy Because these are macros, if <B><I>srcp</I></B> and <B><I>destp</I></B> are pointers, 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.</P>
48<P>The difference from <CODE>MI_CpuCopy*()</CODE> is that because <CODE>SVC_CpuCopy*()</CODE> operates with system ROM, it operates with half the frequency of operating with cache or TCM. However, if cache is valid, there is no difference with the loop, and the difference will be the generation of overhead for calling SVC function. The methods of specifying argument are different each other. If it is possible to describe with either function, it would be better to use <CODE>MI_CpuCopy*()</CODE> instead of <CODE>SVC_CpuCopy*()</CODE> if there is no particular reason to use this.</P>
49<P><CODE>SVC_CpuCopy()</CODE> copies <EM><STRONG><CODE>size</CODE></STRONG></EM> bytes of data from the address shown by <EM><STRONG><CODE>srcp</CODE></STRONG></EM> to the address designated by <EM><STRONG><CODE>destp</CODE></STRONG></EM>. When the transmit bit is set to 16, you must align <EM><STRONG><CODE>srcp</CODE></STRONG></EM> and <EM><STRONG><CODE>destp</CODE></STRONG></EM> to a 2-byte boundary; when the transmit bit is 32, you must align <EM><STRONG><CODE>srcp</CODE></STRONG></EM> and <EM><STRONG><CODE>destp</CODE></STRONG></EM> to a 4-byte boundary.</P>
50<P><CODE>SVC_CpuCopyArray()</CODE> is <CODE>SVC_CpuCopy()</CODE> with transmit size set to <CODE>sizeof(  <EM><STRONG>srcp</STRONG></EM>  )</CODE>. In other words, it is the same as:<br /> <CODE>SVC_CpuCopy(  <EM><STRONG>srcp</STRONG></EM>,  <EM><STRONG>destp</STRONG></EM>, sizeof(  <EM><STRONG>srcp</STRONG></EM>  ),  <EM><STRONG>bit</STRONG></EM>  )</CODE>.</P>
51<P><CODE>SVC_CpuCopyFast()</CODE> quickly copies <EM><STRONG><CODE>size</CODE></STRONG></EM> bytes of data from the address shown by <EM><STRONG><CODE>srcp</CODE></STRONG></EM> to 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>srcp</CODE></STRONG></EM> and <EM><STRONG><CODE>destp</CODE></STRONG></EM> to a 4-byte boundary.</P>
52<P><CODE>SVC_CpuCopyArrayFast()</CODE> is  <CODE>SVC_CpuCopyFast()</CODE> with the transmit size set to <CODE>sizeof(  <EM><STRONG>srcp</STRONG></EM>  )</CODE>. In other words, it is the same as:<br /> <CODE>SVC_CpuCopyFast(  <EM><STRONG>srcp</STRONG></EM>,  <EM><STRONG>destp</STRONG></EM>,  sizeof(<EM><STRONG>srcp</STRONG></EM>)  )</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>, <code><a href="../mi/dma/MI_DmaCopy.html">MI_DmaCopy*</a></code>, <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 call is used.<br /> 2004/01/18 Initial Version</P>
59<hr><p>CONFIDENTIAL</p></body>
60</HTML>