Adding support for BeagleBoard.
[mirror_edk2.git] / ArmPkg / Include / AsmMacroIoLib.inc
1 ;%HEADER%
2 ;/** @file
3 ; Macros to work around lack of Apple support for LDR register, =expr
4 ;
5 ; Copyright (c) 2009, Apple, Inc. All rights reserved.
6 ;
7 ;**/
8
9
10 MACRO
11 MmioWrite32Macro $Address, $Data
12 ldr r1, = ($Address)
13 ldr r0, = ($Data)
14 str r0, [r1]
15 MEND
16
17 MACRO
18 MmioOr32Macro $Address, $OrData
19 ldr r1, =($Address)
20 ldr r2, =($OrData)
21 ldr r0, [r1]
22 orr r0, r0, r2
23 str r0, [r1]
24 MEND
25
26 MACRO
27 MmioAnd32Macro $Address, $AndData
28 ldr r1, =($Address)
29 ldr r2, =($AndData)
30 ldr r0, [r1]
31 and r0, r0, r2
32 str r0, [r1]
33 MEND
34
35 MACRO
36 MmioAndThenOr32Macro $Address, $AndData, $OrData
37 ldr r1, =($Address)
38 ldr r0, [r1]
39 ldr r2, =($AndData)
40 and r0, r0, r2
41 ldr r2, =($OrData)
42 orr r0, r0, r2
43 str r0, [r1]
44 MEND
45
46 MACRO
47 MmioWriteFromReg32Macro $Address, $Reg
48 ldr r1, =($Address)
49 str $Reg, [r1]
50 MEND
51
52 MACRO
53 MmioRead32Macro $Address
54 ldr r1, =($Address)
55 ldr r0, [r1]
56 MEND
57
58 MACRO
59 MmioReadToReg32Macro $Address, $Reg
60 ldr r1, =($Address)
61 ldr $Reg, [r1]
62 MEND
63
64 MACRO
65 LoadConstantMacro $Data
66 ldr r0, =($Data)
67 MEND
68
69 MACRO
70 LoadConstantToRegMacro $Data, $Reg
71 ldr $Reg, =($Data)
72 MEND
73
74 END