Last change
on this file was 108794, checked in by vboxsync, 4 weeks ago |
Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643
|
-
Property svn:eol-style
set to
native
|
File size:
818 bytes
|
Line | |
---|
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 | int
|
---|
17 | memcmp (
|
---|
18 | void *,
|
---|
19 | void *,
|
---|
20 | size_t
|
---|
21 | );
|
---|
22 |
|
---|
23 | #pragma intrinsic(memcmp)
|
---|
24 | #pragma function(memcmp)
|
---|
25 | int
|
---|
26 | memcmp (
|
---|
27 | const void *s1,
|
---|
28 | const void *s2,
|
---|
29 | size_t n
|
---|
30 | )
|
---|
31 | {
|
---|
32 | unsigned char const *t1;
|
---|
33 | unsigned char const *t2;
|
---|
34 |
|
---|
35 | t1 = s1;
|
---|
36 | t2 = s2;
|
---|
37 |
|
---|
38 | while (n-- != 0) {
|
---|
39 | if (*t1 != *t2) {
|
---|
40 | return (int)*t1 - (int)*t2;
|
---|
41 | }
|
---|
42 |
|
---|
43 | t1++;
|
---|
44 | t2++;
|
---|
45 | }
|
---|
46 |
|
---|
47 | return 0;
|
---|
48 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.