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