]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
ArmPkg/Library/CompilerIntrinsicsLib: Enable VS2017/ARM builds
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / memcpy_ms.c
1 //------------------------------------------------------------------------------
2 //
3 // Copyright (c) 2017, Pete Batard. All rights reserved.<BR>
4 //
5 // This program and the accompanying materials are licensed and made
6 // available under the terms and conditions of the BSD License which
7 // accompanies this distribution. The full text of the license may be
8 // found at http://opensource.org/licenses/bsd-license.php
9 //
10 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
12 // IMPLIED.
13 //
14 //------------------------------------------------------------------------------
15
16 #if defined(_M_ARM64)
17 typedef unsigned __int64 size_t;
18 #else
19 typedef unsigned __int32 size_t;
20 #endif
21
22 void* memcpy(void *, const void *, size_t);
23 #pragma intrinsic(memcpy)
24 #pragma function(memcpy)
25 void* memcpy(void *dest, const void *src, size_t n)
26 {
27 unsigned char *d = dest;
28 unsigned char const *s = src;
29
30 while (n--)
31 *d++ = *s++;
32
33 return dest;
34 }