3 ; Macros to work around lack of Apple support for LDR register, =expr
5 ; Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
6 ; Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
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
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.
20 MmioWrite32Macro $Address, $Data
27 MmioOr32Macro $Address, $OrData
36 MmioAnd32Macro $Address, $AndData
45 MmioAndThenOr32Macro $Address, $AndData, $OrData
56 MmioWriteFromReg32Macro $Address, $Reg
62 MmioRead32Macro $Address
68 MmioReadToReg32Macro $Address, $Reg
74 LoadConstantMacro $Data
79 LoadConstantToRegMacro $Data, $Reg
84 GetCorePositionFromMpId $Pos, $MpId, $Tmp
85 ;Note: The ARM macro does not support the pre-processing. 0xFF and (0xFF << 8) are the values of
86 ; ARM_CORE_MASK and ARM_CLUSTER_MASK
87 mov $Tmp, #(0xFF :OR: (0xFF << 8))
94 ; The reserved place must be 8-bytes aligned for pushing 64-bit variable on the stack
95 ; Note: Global Size will be modified
97 SetPrimaryStack $StackTop, $GlobalSize, $Tmp
98 and $Tmp, $GlobalSize, #7
100 add $GlobalSize, $GlobalSize, $Tmp
101 sub sp, $StackTop, $GlobalSize
103 ; Set all the global variables to 0
105 mov $GlobalSize, #0x0
106 _SetPrimaryStackInitGlobals
108 beq _SetPrimaryStackEnd
109 str $GlobalSize, [$Tmp], #4
110 b _SetPrimaryStackInitGlobals
115 InitializePrimaryStack $GlobalSize, $Tmp1
116 and $Tmp1, $GlobalSize, #7
117 rsbne $Tmp1, $Tmp1, #8
118 add $GlobalSize, $GlobalSize, $Tmp1
122 ; Set all the global variables to 0
123 mov $GlobalSize, #0x0
124 _InitializePrimaryStackLoop
126 bls _InitializePrimaryStackEnd
127 str $GlobalSize, [$Tmp1], #-4
128 b _InitializePrimaryStackLoop
129 _InitializePrimaryStackEnd