]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | memcpy.c\r | |
14 | \r | |
15 | Abstract:\r | |
16 | \r | |
17 | The Microsoft compiler inlines memcpy and we can not stop it.\r | |
18 | These routines allow the code to link!\r | |
19 | \r | |
20 | There is no *.h definition of these modules as they are well known by the \r | |
21 | compiler. See Microsoft documentation for more details!\r | |
22 | \r | |
23 | volatile is used to prevent the compiler from trying to implement these\r | |
24 | C functions as inline functions. \r | |
25 | \r | |
26 | --*/\r | |
27 | \r | |
28 | #include "Tiano.h"\r | |
29 | \r | |
30 | VOID *\r | |
808bfde2 | 31 | memcpy (\r |
32 | OUT VOID *Dest,\r | |
33 | IN const VOID *Src,\r | |
34 | IN UINTN Count\r | |
35 | )\r | |
36 | ;\r | |
37 | \r | |
38 | #ifdef _MSC_EXTENSIONS\r | |
39 | #pragma intrinsic(memcpy)\r | |
40 | #else\r | |
41 | VOID *\r | |
3eb9473e | 42 | memcpy (\r |
43 | OUT VOID *Dest,\r | |
44 | IN const VOID *Src,\r | |
45 | IN UINTN Count\r | |
46 | )\r | |
47 | {\r | |
48 | volatile UINT8 *Ptr;\r | |
49 | const UINT8 *Source;\r | |
50 | \r | |
51 | for (Ptr = Dest, Source = Src; Count > 0; Count--, Source++, Ptr++) {\r | |
52 | *Ptr = *Source;\r | |
53 | }\r | |
54 | \r | |
55 | return Dest;\r | |
56 | }\r | |
808bfde2 | 57 | #endif\r |
3eb9473e | 58 | \r |