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