TianoCore EDK2
master
Loading...
Searching...
No Matches
memmove_ms.c
1
// ------------------------------------------------------------------------------
2
//
3
// Copyright (c) 2019, Pete Batard. All rights reserved.
4
// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
5
//
6
// SPDX-License-Identifier: BSD-2-Clause-Patent
7
//
8
// ------------------------------------------------------------------------------
9
10
#if defined (_M_ARM64)
11
typedef
unsigned
__int64 size_t;
12
#else
13
typedef
unsigned
__int32 size_t;
14
#endif
15
16
void
*
17
memmove (
18
void
*,
19
const
void
*,
20
size_t
21
);
22
23
#pragma intrinsic(memmove)
24
#pragma function(memmove)
25
void
*
26
memmove (
27
void
*dest,
28
const
void
*src,
29
size_t
n
30
)
31
{
32
unsigned
char
*d;
33
unsigned
char
const
*s;
34
35
d = dest;
36
s = src;
37
38
if
(d < s) {
39
while
(n-- != 0) {
40
*d++ = *s++;
41
}
42
}
else
{
43
d += n;
44
s += n;
45
while
(n-- != 0) {
46
*--d = *--s;
47
}
48
}
49
50
return
dest;
51
}
MdePkg
Library
CompilerIntrinsicsLib
memmove_ms.c
Generated on Fri Nov 15 2024 18:01:17 for TianoCore EDK2 by
1.9.6