]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmLib/Arm9/Arm9Support.asm
Remove tabs from all text files in the package.
[mirror_edk2.git] / ArmPkg / Library / ArmLib / Arm9 / Arm9Support.asm
CommitLineData
2ef2b01e
A
1//------------------------------------------------------------------------------
2//
d6ebcab7 3// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
2ef2b01e 4//
d6ebcab7 5// This program and the accompanying materials
2ef2b01e
A
6// are licensed and made available under the terms and conditions of the BSD License
7// which accompanies this distribution. The full text of the license may be found at
8// http://opensource.org/licenses/bsd-license.php
9//
10// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12//
13//------------------------------------------------------------------------------
14
15 EXPORT ArmCleanInvalidateDataCache
16 EXPORT ArmCleanDataCache
17 EXPORT ArmInvalidateDataCache
18 EXPORT ArmInvalidateInstructionCache
19 EXPORT ArmInvalidateDataCacheEntryByMVA
20 EXPORT ArmCleanDataCacheEntryByMVA
21 EXPORT ArmCleanInvalidateDataCacheEntryByMVA
22 EXPORT ArmEnableMmu
23 EXPORT ArmDisableMmu
c2b5ca8b 24 EXPORT ArmMmuEnabled
2ef2b01e
A
25 EXPORT ArmEnableDataCache
26 EXPORT ArmDisableDataCache
27 EXPORT ArmEnableInstructionCache
28 EXPORT ArmDisableInstructionCache
29 EXPORT ArmEnableBranchPrediction
30 EXPORT ArmDisableBranchPrediction
4b9fa129 31 EXPORT ArmDataMemoryBarrier
32 EXPORT ArmDataSyncronizationBarrier
33 EXPORT ArmInstructionSynchronizationBarrier
2ef2b01e
A
34
35
36DC_ON EQU ( 0x1:SHL:2 )
37IC_ON EQU ( 0x1:SHL:12 )
38
39 AREA ArmCacheLib, CODE, READONLY
40 PRESERVE8
41
42
43ArmInvalidateDataCacheEntryByMVA
44 MCR p15, 0, r0, c7, c6, 1 ; invalidate single data cache line
45 BX lr
46
47
48ArmCleanDataCacheEntryByMVA
49 MCR p15, 0, r0, c7, c10, 1 ; clean single data cache line
50 BX lr
51
52
53ArmCleanInvalidateDataCacheEntryByMVA
54 MCR p15, 0, r0, c7, c14, 1 ; clean and invalidate single data cache line
55 BX lr
56
57ArmEnableInstructionCache
58 LDR R1,=IC_ON
59 MRC p15,0,R0,c1,c0,0 ;Read control register configuration data
60 ORR R0,R0,R1 ;Set I bit
61 MCR p15,0,r0,c1,c0,0 ;Write control register configuration data
62 BX LR
63
64ArmDisableInstructionCache
65 LDR R1,=IC_ON
66 MRC p15,0,R0,c1,c0,0 ;Read control register configuration data
67 BIC R0,R0,R1 ;Clear I bit.
68 MCR p15,0,r0,c1,c0,0 ;Write control register configuration data
69 BX LR
70
71ArmInvalidateInstructionCache
72 MOV R0,#0
73 MCR p15,0,R0,c7,c5,0 ;Invalidate entire instruction cache
74 MOV R0,#0
75 MCR p15,0,R0,c7,c10,4 ;Drain write buffer
76 BX LR
77
78ArmEnableMmu
79 mrc p15,0,R0,c1,c0,0
80 orr R0,R0,#1
81 mcr p15,0,R0,c1,c0,0
82 bx LR
83
c2b5ca8b
A
84ArmMmuEnabled
85 mrc p15,0,R0,c1,c0,0
86 and R0,R0,#1
87 bx LR
88
2ef2b01e
A
89ArmDisableMmu
90 mrc p15,0,R0,c1,c0,0
91 bic R0,R0,#1
92 mcr p15,0,R0,c1,c0,0
93 mov R0,#0
94 mcr p15,0,R0,c7,c10,4 ;Drain write buffer
95 bx LR
96
97ArmEnableDataCache
98 LDR R1,=DC_ON
99 MRC p15,0,R0,c1,c0,0 ;Read control register configuration data
100 ORR R0,R0,R1 ;Set C bit
101 MCR p15,0,r0,c1,c0,0 ;Write control register configuration data
102 BX LR
103
104ArmDisableDataCache
105 LDR R1,=DC_ON
106 MRC p15,0,R0,c1,c0,0 ;Read control register configuration data
107 BIC R0,R0,R1 ;Clear C bit
108 MCR p15,0,r0,c1,c0,0 ;Write control register configuration data
109 BX LR
110
111ArmCleanDataCache
112 MRC p15,0,r15,c7,c10,3
113 BNE ArmCleanDataCache
114 MOV R0,#0
58b5d037 115 MCR p15,0,R0,c7,c10,4\s\s ;Drain write buffer
2ef2b01e
A
116 BX LR
117
118ArmInvalidateDataCache
119 MOV R0,#0
120 MCR p15,0,R0,c7,c6,0 ;Invalidate entire data cache
121 MOV R0,#0
122 MCR p15,0,R0,c7,c10,4 ;Drain write buffer
123 BX LR
124
125ArmCleanInvalidateDataCache
126 MRC p15,0,r15,c7,c14,3
127 BNE ArmCleanInvalidateDataCache
128 MOV R0,#0
58b5d037 129 MCR p15,0,R0,c7,c10,4\s\s ;Drain write buffer
2ef2b01e
A
130 BX LR
131
132ArmEnableBranchPrediction
133 bx LR ;Branch prediction is not supported.
134
135ArmDisableBranchPrediction
136 bx LR ;Branch prediction is not supported.
137
4b9fa129 138ASM_PFX(ArmDataMemoryBarrier):
139 mov R0, #0
140 mcr P15, #0, R0, C7, C10, #5 ; Check to see if this is correct
141 bx LR
142
143ASM_PFX(ArmDataSyncronizationBarrier):
144 mov R0, #0
145 mcr P15, #0, R0, C7, C10, #4 ; Check to see if this is correct
146 bx LR
147
148ASM_PFX(ArmInstructionSynchronizationBarrier):
149 MOV R0, #0
150 MCR P15, #0, R0, C7, C5, #4 ; Check to see if this is correct
151 bx LR
152
2ef2b01e 153 END