TianoCore EDK2 master
Loading...
Searching...
No Matches
memcpy.c
1// ------------------------------------------------------------------------------
2//
3// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
4// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
5//
6// SPDX-License-Identifier: BSD-2-Clause-Patent
7//
8// ------------------------------------------------------------------------------
9
10typedef __SIZE_TYPE__ size_t;
11
12static void
13__memcpy (
14 void *dest,
15 const void *src,
16 size_t n
17 )
18{
19 unsigned char *d;
20 unsigned char const *s;
21
22 d = dest;
23 s = src;
24
25 while (n-- != 0) {
26 *d++ = *s++;
27 }
28}
29
30void *
31memcpy (
32 void *dest,
33 const void *src,
34 size_t n
35 )
36{
37 __memcpy (dest, src, n);
38 return dest;
39}
40
41#ifdef __arm__
42
43__attribute__ ((__alias__ ("__memcpy")))
44void
45__aeabi_memcpy (
46 void *dest,
47 const void *src,
48 size_t n
49 );
50
51__attribute__ ((__alias__ ("__memcpy")))
52void
53__aeabi_memcpy4 (
54 void *dest,
55 const void *src,
56 size_t n
57 );
58
59__attribute__ ((__alias__ ("__memcpy")))
60void
61__aeabi_memcpy8 (
62 void *dest,
63 const void *src,
64 size_t n
65 );
66
67#endif
unsigned long long UINT64 __attribute__((aligned(8)))
Definition: ProcessorBind.h:28