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 __attribute__((__used__)) 19 void *__memcpy(void *dest, const void *src, size_t n) 20 { 21 unsigned char *d = dest; 22 unsigned char const *s = src; 23 24 while (n--) 25 *d++ = *s++; 26 27 return dest; 28 } 29 30 __attribute__((__alias__("__memcpy"))) 31 void *memcpy(void *dest, const void *src, size_t n); 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 45