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