]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c
ArmPkg/CompilerIntrinsicsLib: fix GCC8 warning for __aeabi_memcpy aliases
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / memcpy.c
1 //------------------------------------------------------------------------------
2 //
3 // Copyright (c) 2016, Linaro Ltd. 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 typedef __SIZE_TYPE__ size_t;
17
18 static void __memcpy(void *dest, const void *src, size_t n)
19 {
20 unsigned char *d = dest;
21 unsigned char const *s = src;
22
23 while (n--)
24 *d++ = *s++;
25 }
26
27 void *memcpy(void *dest, const void *src, size_t n)
28 {
29 __memcpy(dest, src, n);
30 return dest;
31 }
32
33 #ifdef __arm__
34
35 __attribute__((__alias__("__memcpy")))
36 void __aeabi_memcpy(void *dest, const void *src, size_t n);
37
38 __attribute__((__alias__("__memcpy")))
39 void __aeabi_memcpy4(void *dest, const void *src, size_t n);
40
41 __attribute__((__alias__("__memcpy")))
42 void __aeabi_memcpy8(void *dest, const void *src, size_t n);
43
44 #endif