MdePkg/BaseMemoryLibOptDxe ARM: add missing function annotations
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibOptDxe / Arm / CompareGuid.S
1 //
2 // Copyright (c) 2016, Linaro Limited
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 // * Neither the name of the Linaro nor the
13 // names of its contributors may be used to endorse or promote products
14 // derived from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //
28
29 .text
30 .thumb
31 .syntax unified
32 .align 5
33 .type ASM_PFX(InternalMemCompareGuid), %function
34 ASM_GLOBAL ASM_PFX(InternalMemCompareGuid)
35 ASM_PFX(InternalMemCompareGuid):
36 push {r4, lr}
37 ldr r2, [r0]
38 ldr r3, [r0, #4]
39 ldr r4, [r0, #8]
40 ldr r0, [r0, #12]
41 cbz r1, 1f
42 ldr ip, [r1]
43 ldr lr, [r1, #4]
44 cmp r2, ip
45 it eq
46 cmpeq.n r3, lr
47 beq 0f
48 movs r0, #0
49 pop {r4, pc}
50
51 0: ldr r2, [r1, #8]
52 ldr r3, [r1, #12]
53 cmp r4, r2
54 it eq
55 cmpeq.n r0, r3
56 bne 2f
57 movs r0, #1
58 pop {r4, pc}
59
60 1: orrs r2, r2, r3
61 orrs r4, r4, r0
62 movs r0, #1
63 orrs r2, r2, r4
64 2: it ne
65 movne.n r0, #0
66 pop {r4, pc}