]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Helper.S
Arm Packages: Fix builds for XCODE32 toolchain
[mirror_edk2.git] / ArmPkg / Drivers / ArmCpuLib / ArmCortexA15Lib / ArmCortexA15Helper.S
1 //
2 // Copyright (c) 2011, ARM Limited. All rights reserved.
3 //
4 // This program and the accompanying materials
5 // are licensed and made available under the terms and conditions of the BSD License
6 // which accompanies this distribution. The full text of the license may be found at
7 // http://opensource.org/licenses/bsd-license.php
8 //
9 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 //
12 //
13
14 #include <AsmMacroIoLib.h>
15 #include <Library/ArmCpuLib.h>
16 #include <Library/ArmGicLib.h>
17 #include <Library/PcdLib.h>
18 #include <Chipset/ArmV7.h>
19
20 .text
21 .align 3
22
23 GCC_ASM_EXPORT(ArmCpuSynchronizeWait)
24 GCC_ASM_IMPORT(CArmCpuSynchronizeWait)
25 // Dirty hack to get the Fixed value of GicDistributorBase
26 GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdGicDistributorBase)
27
28
29 // VOID
30 // ArmCpuSynchronizeWait (
31 // IN ARM_CPU_SYNCHRONIZE_EVENT Event
32 // );
33 ASM_PFX(ArmCpuSynchronizeWait):
34 cmp r0, #ARM_CPU_EVENT_BOOT_MEM_INIT
35 // The SCU enabled is the event to tell us the Init Boot Memory is initialized
36 beq ArmWaitGicDistributorEnabled
37 bx ASM_PFX(CArmCpuSynchronizeWait)
38
39 // IN None
40 ArmWaitGicDistributorEnabled:
41 LoadConstantToReg (ASM_PFX(_gPcd_FixedAtBuild_PcdGicDistributorBase), r0)
42 ldr r0, [r0]
43 _WaitGicDistributor:
44 ldr r1, [r0, #ARM_GIC_ICDDCR]
45 cmp r1, #1
46 bne _WaitGicDistributor
47 bx lr