1 #------------------------------------------------------------------------------
3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 # This program and the accompanying materials
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
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.
13 #------------------------------------------------------------------------------
17 .globl ASM_PFX(ArmCleanInvalidateDataCache)
18 INTERWORK_FUNC(ArmCleanInvalidateDataCache)
19 .globl ASM_PFX(ArmCleanDataCache)
20 INTERWORK_FUNC(ArmCleanDataCache)
21 .globl ASM_PFX(ArmInvalidateDataCache)
22 INTERWORK_FUNC(ArmInvalidateDataCache)
23 .globl ASM_PFX(ArmInvalidateInstructionCache)
24 INTERWORK_FUNC(ArmInvalidateInstructionCache)
25 .globl ASM_PFX(ArmInvalidateDataCacheEntryByMVA)
26 INTERWORK_FUNC(ArmInvalidateDataCacheEntryByMVA)
27 .globl ASM_PFX(ArmCleanDataCacheEntryByMVA)
28 INTERWORK_FUNC(ArmCleanDataCacheEntryByMVA)
29 .globl ASM_PFX(ArmCleanInvalidateDataCacheEntryByMVA)
30 INTERWORK_FUNC(ArmCleanInvalidateDataCacheEntryByMVA)
31 .globl ASM_PFX(ArmEnableMmu)
32 INTERWORK_FUNC(ArmEnableMmu)
33 .globl ASM_PFX(ArmDisableMmu)
34 INTERWORK_FUNC(ArmDisableMmu)
35 .globl ASM_PFX(ArmMmuEnabled)
36 INTERWORK_FUNC(ArmMmuEnabled)
37 .globl ASM_PFX(ArmEnableDataCache)
38 INTERWORK_FUNC(ArmEnableDataCache)
39 .globl ASM_PFX(ArmDisableDataCache)
40 INTERWORK_FUNC(ArmDisableDataCache)
41 .globl ASM_PFX(ArmEnableInstructionCache)
42 INTERWORK_FUNC(ArmEnableInstructionCache)
43 .globl ASM_PFX(ArmDisableInstructionCache)
44 INTERWORK_FUNC(ArmDisableInstructionCache)
45 .globl ASM_PFX(ArmEnableBranchPrediction)
46 INTERWORK_FUNC(ArmEnableBranchPrediction)
47 .globl ASM_PFX(ArmDisableBranchPrediction)
48 INTERWORK_FUNC(ArmDisableBranchPrediction)
49 .globl ASM_PFX(ArmDataMemoryBarrier)
50 INTERWORK_FUNC(ArmDataMemoryBarrier)
51 .globl ASM_PFX(ArmDataSyncronizationBarrier)
52 INTERWORK_FUNC(ArmDataSyncronizationBarrier)
53 .globl ASM_PFX(ArmInstructionSynchronizationBarrier)
54 INTERWORK_FUNC(ArmInstructionSynchronizationBarrier)
60 #------------------------------------------------------------------------------
62 ASM_PFX(ArmInvalidateDataCacheEntryByMVA):
63 mcr p15, 0, r0, c7, c6, 1 @ invalidate single data cache line
66 ASM_PFX(ArmCleanDataCacheEntryByMVA):
67 mcr p15, 0, r0, c7, c10, 1 @ clean single data cache line
70 ASM_PFX(ArmCleanInvalidateDataCacheEntryByMVA):
71 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate single data cache line
74 ASM_PFX(ArmEnableInstructionCache):
76 mrc p15,0,r0,c1,c0,0 @Read control register configuration data
77 orr r0,r0,r1 @Set I bit
78 mcr p15,0,r0,c1,c0,0 @Write control register configuration data
81 ASM_PFX(ArmDisableInstructionCache):
83 mrc p15,0,r0,c1,c0,0 @Read control register configuration data
84 bic r0,r0,r1 @Clear I bit.
85 mcr p15,0,r0,c1,c0,0 @Write control register configuration data
88 ASM_PFX(ArmInvalidateInstructionCache):
90 mcr p15,0,r0,c7,c5,0 @Invalidate entire Instruction cache.
91 @Also flushes the branch target cache.
93 mcr p15,0,r0,c7,c10,4 @Data write buffer
96 ASM_PFX(ArmEnableMmu):
102 ASM_PFX(ArmMmuEnabled):
107 ASM_PFX(ArmDisableMmu):
112 mcr p15,0,R0,c7,c10,4 @Drain write buffer
115 ASM_PFX(ArmEnableDataCache):
117 mrc p15,0,R0,c1,c0,0 @Read control register configuration data
118 orr R0,R0,R1 @Set C bit
119 mcr p15,0,r0,c1,c0,0 @Write control register configuration data
122 ASM_PFX(ArmDisableDataCache):
124 mrc p15,0,R0,c1,c0,0 @Read control register configuration data
125 bic R0,R0,R1 @Clear C bit
126 mcr p15,0,r0,c1,c0,0 @Write control register configuration data
129 ASM_PFX(ArmCleanDataCache):
130 mrc p15,0,r15,c7,c10,3
131 bne ASM_PFX(ArmCleanDataCache)
133 mcr p15,0,R0,c7,c10,4 @Drain write buffer
136 ASM_PFX(ArmInvalidateDataCache):
138 mcr p15,0,R0,c7,c6,0 @Invalidate entire data cache
140 mcr p15,0,R0,c7,c10,4 @Drain write buffer
143 ASM_PFX(ArmCleanInvalidateDataCache):
144 mrc p15,0,r15,c7,c14,3
145 bne ASM_PFX(ArmCleanInvalidateDataCache)
147 mcr p15,0,R0,c7,c10,4 @Drain write buffer
150 ASM_PFX(ArmEnableBranchPrediction):
151 bx LR @Branch prediction is not supported.
153 ASM_PFX(ArmDisableBranchPrediction):
154 bx LR @Branch prediction is not supported.
156 ASM_PFX(ArmDataMemoryBarrier):
158 mcr P15, #0, R0, C7, C10, #5 @ check if this is OK?
161 ASM_PFX(ArmDataSyncronizationBarrier):
163 mcr P15, #0, R0, C7, C10, #4 @ check if this is OK?
166 ASM_PFX(ArmInstructionSynchronizationBarrier):
168 mcr P15, #0, R0, C7, C5, #4 @ check if this is OK?
171 ASM_FUNCTION_REMOVE_IF_UNREFERENCED