]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Library/ArmSmcLib/ArmSmc.S
ArmPkg/DebugPeCoffExtraActionLib: Checked the ImageContext->PdbPointer is not null
[mirror_edk2.git] / ArmPlatformPkg / Library / ArmSmcLib / ArmSmc.S
1 //
2 // Copyright (c) 2012, ARM Limited. All rights reserved.
3 //
4 // This program and the accompanying materials
5 // are licensed and made available under the terms and conditions of the BSD License
6 // which accompanies this distribution. The full text of the license may be found at
7 // http://opensource.org/licenses/bsd-license.php
8 //
9 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 //
12 //
13
14 .text
15 .align 3
16 .arch_extension sec
17
18 GCC_ASM_EXPORT(ArmCallSmc)
19 GCC_ASM_EXPORT(ArmCallSmcArg1)
20 GCC_ASM_EXPORT(ArmCallSmcArg2)
21 GCC_ASM_EXPORT(ArmCallSmcArg3)
22
23 ASM_PFX(ArmCallSmc):
24 push {r1}
25 mov r1, r0
26 ldr r0,[r1]
27 smc #0
28 str r0,[r1]
29 pop {r1}
30 blx lr
31
32 // Arg1 in R1
33 ASM_PFX(ArmCallSmcArg1):
34 push {r2-r3}
35 mov r2, r0
36 mov r3, r1
37 ldr r0,[r2]
38 ldr r1,[r3]
39 smc #0
40 str r0,[r2]
41 str r1,[r3]
42 pop {r2-r3}
43 blx lr
44
45 ASM_PFX(ArmCallSmcArg2):
46 push {r3-r5}
47 mov r3, r0
48 mov r4, r1
49 mov r5, r2
50 ldr r0,[r3]
51 ldr r1,[r4]
52 ldr r2,[r5]
53 smc #0
54 str r0,[r3]
55 str r1,[r4]
56 str r2,[r5]
57 pop {r3-r5}
58 blx lr
59
60 ASM_PFX(ArmCallSmcArg3):
61 push {r4-r7}
62 mov r4, r0
63 mov r5, r1
64 mov r6, r2
65 mov r7, r3
66 ldr r0,[r4]
67 ldr r1,[r5]
68 ldr r2,[r6]
69 ldr r3,[r7]
70 smc #0
71 str r0,[r4]
72 str r1,[r5]
73 str r2,[r6]
74 str r3,[r7]
75 pop {r4-r7}
76 blx lr