]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Helper.asm
ArmPkg/ArmCpuLib: Fix GCC/XCode builds
[mirror_edk2.git] / ArmPkg / Drivers / ArmCpuLib / ArmCortexA15Lib / ArmCortexA15Helper.asm
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 INCLUDE AsmMacroIoLib.inc\r
21\r
22 EXPORT ArmCpuSynchronizeWait\r
23 IMPORT CArmCpuSynchronizeWait\r
24 // Dirty hack to get the Fixed value of GicDistributorBase\r
25 IMPORT _gPcd_FixedAtBuild_PcdGicDistributorBase\r
26\r
27 PRESERVE8\r
28 AREA ArmCortexA15Helper, CODE, READONLY\r
29\r
30// VOID\r
31// ArmCpuSynchronizeWait (\r
32// IN ARM_CPU_SYNCHRONIZE_EVENT Event\r
33// );\r
34ArmCpuSynchronizeWait\r
35 cmp r0, #ARM_CPU_EVENT_BOOT_MEM_INIT\r
36 // The SCU enabled is the event to tell us the Init Boot Memory is initialized\r
37 beq ArmWaitGicDistributorEnabled\r
81be6e07 38 // Case when the stack has been set up\r
39 push {r1,lr}\r
40 LoadConstantToReg (CArmCpuSynchronizeWait, r1)\r
41 blx r1\r
42 pop {r1,lr}\r
43 bx lr\r
44\r
88d4f51d 45\r
46// IN None\r
47ArmWaitGicDistributorEnabled\r
48 LoadConstantToReg (_gPcd_FixedAtBuild_PcdGicDistributorBase, r0)\r
49 ldr r0, [r0]\r
50_WaitGicDistributor\r
51 ldr r1, [r0, #ARM_GIC_ICDDCR]\r
52 cmp r1, #1\r
53 bne _WaitGicDistributor\r
54 bx lr\r
55\r
56 END\r