]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c
ArmPkg/CompilerIntrinsicsLib: fix GCC8 warning for __aeabi_memcpy aliases
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / memcpy.c
CommitLineData
a0cf6b8d
AB
1//------------------------------------------------------------------------------\r
2//\r
3// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
4//\r
5// This program and the accompanying materials are licensed and made\r
6// available under the terms and conditions of the BSD License which\r
7// accompanies this distribution. The full text of the license may be\r
8// found at http://opensource.org/licenses/bsd-license.php\r
9//\r
10// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR\r
12// IMPLIED.\r
13//\r
14//------------------------------------------------------------------------------\r
15\r
16typedef __SIZE_TYPE__ size_t;\r
17\r
a683ceca 18static void __memcpy(void *dest, const void *src, size_t n)\r
a0cf6b8d
AB
19{\r
20 unsigned char *d = dest;\r
21 unsigned char const *s = src;\r
22\r
23 while (n--)\r
24 *d++ = *s++;\r
a683ceca 25}\r
a0cf6b8d 26\r
a683ceca
MZ
27void *memcpy(void *dest, const void *src, size_t n)\r
28{\r
29 __memcpy(dest, src, n);\r
a0cf6b8d
AB
30 return dest;\r
31}\r
32\r
a0cf6b8d
AB
33#ifdef __arm__\r
34\r
35__attribute__((__alias__("__memcpy")))\r
36void __aeabi_memcpy(void *dest, const void *src, size_t n);\r
37\r
38__attribute__((__alias__("__memcpy")))\r
39void __aeabi_memcpy4(void *dest, const void *src, size_t n);\r
40\r
41__attribute__((__alias__("__memcpy")))\r
42void __aeabi_memcpy8(void *dest, const void *src, size_t n);\r
43\r
44#endif\r