]>
Commit | Line | Data |
---|---|---|
1 | ;%HEADER%\r | |
2 | ;/** @file\r | |
3 | ; Macros to work around lack of Apple support for LDR register, =expr\r | |
4 | ;\r | |
5 | ; Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r | |
6 | ; Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r | |
7 | ;\r | |
8 | ; This program and the accompanying materials\r | |
9 | ; are licensed and made available under the terms and conditions of the BSD License\r | |
10 | ; which accompanies this distribution. The full text of the license may be found at\r | |
11 | ; http://opensource.org/licenses/bsd-license.php\r | |
12 | ;\r | |
13 | ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | ;\r | |
16 | ;**/\r | |
17 | \r | |
18 | \r | |
19 | MACRO\r | |
20 | MmioWrite32Macro $Address, $Data\r | |
21 | ldr r1, = ($Address)\r | |
22 | ldr r0, = ($Data)\r | |
23 | str r0, [r1]\r | |
24 | MEND\r | |
25 | \r | |
26 | MACRO\r | |
27 | MmioOr32Macro $Address, $OrData\r | |
28 | ldr r1, =($Address)\r | |
29 | ldr r2, =($OrData)\r | |
30 | ldr r0, [r1]\r | |
31 | orr r0, r0, r2\r | |
32 | str r0, [r1]\r | |
33 | MEND\r | |
34 | \r | |
35 | MACRO\r | |
36 | MmioAnd32Macro $Address, $AndData\r | |
37 | ldr r1, =($Address)\r | |
38 | ldr r2, =($AndData)\r | |
39 | ldr r0, [r1]\r | |
40 | and r0, r0, r2\r | |
41 | str r0, [r1]\r | |
42 | MEND\r | |
43 | \r | |
44 | MACRO\r | |
45 | MmioAndThenOr32Macro $Address, $AndData, $OrData\r | |
46 | ldr r1, =($Address)\r | |
47 | ldr r0, [r1]\r | |
48 | ldr r2, =($AndData)\r | |
49 | and r0, r0, r2\r | |
50 | ldr r2, =($OrData)\r | |
51 | orr r0, r0, r2\r | |
52 | str r0, [r1]\r | |
53 | MEND\r | |
54 | \r | |
55 | MACRO\r | |
56 | MmioWriteFromReg32Macro $Address, $Reg\r | |
57 | ldr r1, =($Address)\r | |
58 | str $Reg, [r1]\r | |
59 | MEND\r | |
60 | \r | |
61 | MACRO\r | |
62 | MmioRead32Macro $Address\r | |
63 | ldr r1, =($Address)\r | |
64 | ldr r0, [r1]\r | |
65 | MEND\r | |
66 | \r | |
67 | MACRO\r | |
68 | MmioReadToReg32Macro $Address, $Reg\r | |
69 | ldr r1, =($Address)\r | |
70 | ldr $Reg, [r1]\r | |
71 | MEND\r | |
72 | \r | |
73 | MACRO\r | |
74 | LoadConstantMacro $Data\r | |
75 | ldr r0, =($Data)\r | |
76 | MEND\r | |
77 | \r | |
78 | MACRO\r | |
79 | LoadConstantToRegMacro $Data, $Reg\r | |
80 | ldr $Reg, =($Data)\r | |
81 | MEND\r | |
82 | \r | |
83 | END\r |