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