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