Update the copyright notice format
[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.<BR>
6 ; This program and the accompanying materials
7 ; are licensed and made available under the terms and conditions of the BSD License
8 ; which accompanies this distribution. The full text of the license may be found at
9 ; http://opensource.org/licenses/bsd-license.php
10 ;
11 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 ;
14 ;**/
15
16
17 MACRO
18 MmioWrite32Macro $Address, $Data
19 ldr r1, = ($Address)
20 ldr r0, = ($Data)
21 str r0, [r1]
22 MEND
23
24 MACRO
25 MmioOr32Macro $Address, $OrData
26 ldr r1, =($Address)
27 ldr r2, =($OrData)
28 ldr r0, [r1]
29 orr r0, r0, r2
30 str r0, [r1]
31 MEND
32
33 MACRO
34 MmioAnd32Macro $Address, $AndData
35 ldr r1, =($Address)
36 ldr r2, =($AndData)
37 ldr r0, [r1]
38 and r0, r0, r2
39 str r0, [r1]
40 MEND
41
42 MACRO
43 MmioAndThenOr32Macro $Address, $AndData, $OrData
44 ldr r1, =($Address)
45 ldr r0, [r1]
46 ldr r2, =($AndData)
47 and r0, r0, r2
48 ldr r2, =($OrData)
49 orr r0, r0, r2
50 str r0, [r1]
51 MEND
52
53 MACRO
54 MmioWriteFromReg32Macro $Address, $Reg
55 ldr r1, =($Address)
56 str $Reg, [r1]
57 MEND
58
59 MACRO
60 MmioRead32Macro $Address
61 ldr r1, =($Address)
62 ldr r0, [r1]
63 MEND
64
65 MACRO
66 MmioReadToReg32Macro $Address, $Reg
67 ldr r1, =($Address)
68 ldr $Reg, [r1]
69 MEND
70
71 MACRO
72 LoadConstantMacro $Data
73 ldr r0, =($Data)
74 MEND
75
76 MACRO
77 LoadConstantToRegMacro $Data, $Reg
78 ldr $Reg, =($Data)
79 MEND
80
81 END