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 //------------------------------------------------------------------------------
18 EXPORT ArmEnableInterrupts
19 EXPORT ArmDisableInterrupts
20 EXPORT ArmGetInterruptState
24 EXPORT ArmInvalidateTlb
25 EXPORT ArmSetTranslationTableBaseAddress
26 EXPORT ArmGetTranslationTableBaseAddress
27 EXPORT ArmSetDomainAccessControl
31 AREA ArmLibSupport, CODE, READONLY
43 bic R0,R0,#0x80 ;Enable IRQ interrupts
49 orr R1,R0,#0x80 ;Disable IRQ interrupts
58 tst R0,#0x80 ;Check if IRQ is enabled.
65 bic R0,R0,#0x40 ;Enable IRQ interrupts
71 orr R1,R0,#0x40 ;Disable IRQ interrupts
80 tst R0,#0x40 ;Check if IRQ is enabled.
90 ArmSetTranslationTableBaseAddress
94 ArmGetTranslationTableBaseAddress
98 ArmSetDomainAccessControl
102 CPSRMaskInsert ; on entry, r0 is the mask and r1 is the field to insert
103 stmfd sp!, {r4-r12, lr} ; save all the banked registers
104 mov r3, sp ; copy the stack pointer into a non-banked register
105 mrs r2, cpsr ; read the cpsr
106 bic r2, r2, r0 ; clear mask in the cpsr
107 and r1, r1, r0 ; clear bits outside the mask in the input
108 orr r2, r2, r1 ; set field
109 msr cpsr_cxsf, r2 ; write back cpsr (may have caused a mode switch)
110 mov sp, r3 ; restore stack pointer
111 ldmfd sp!, {r4-r12, lr} ; restore registers
112 bx lr ; return (hopefully thumb-safe!)