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
83 ; The reserved place must be 8-bytes aligned for pushing 64-bit variable on the stack
84 ; Note: Global Size will be modified
86 SetPrimaryStack $StackTop, $GlobalSize, $Tmp
87 and $Tmp, $GlobalSize, #7
89 add $GlobalSize, $GlobalSize, $Tmp
90 sub sp, $StackTop, $GlobalSize
92 ; Set all the global variables to 0
95 _SetPrimaryStackInitGlobals
97 beq _SetPrimaryStackEnd
98 str $GlobalSize, [$Tmp], #4
99 b _SetPrimaryStackInitGlobals
104 InitializePrimaryStack $GlobalSize, $Tmp1
105 and $Tmp1, $GlobalSize, #7
106 rsbne $Tmp1, $Tmp1, #8
107 add $GlobalSize, $GlobalSize, $Tmp1
111 ; Set all the global variables to 0
112 mov $GlobalSize, #0x0
113 _InitializePrimaryStackLoop
115 bls _InitializePrimaryStackEnd
116 str $GlobalSize, [$Tmp1], #-4
117 b _InitializePrimaryStackLoop
118 _InitializePrimaryStackEnd