3 * Copyright (c) 2013-2014, ARM Limited. All rights reserved.
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include <AsmMacroIoLibV8.h>
16 #include <Library/ArmLib.h>
21 GCC_ASM_EXPORT(ArmPlatformPeiBootAction)
22 GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
23 GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)
24 GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
26 GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask)
29 PrimaryCoreMpid: .word 0x0
32 //ArmPlatformGetCorePosition (
35 // With this function: CorePos = (ClusterId * 2) + CoreId
36 ASM_PFX(ArmPlatformGetCorePosition):
37 and x1, x0, #ARM_CORE_MASK
38 and x0, x0, #ARM_CLUSTER_MASK
39 add x0, x1, x0, LSR #7
43 //ArmPlatformGetPrimaryCoreMpId (
46 ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
47 ldr x0, =PrimaryCoreMpid
52 //ArmPlatformIsPrimaryCore (
55 ASM_PFX(ArmPlatformIsPrimaryCore):
56 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, x1)
60 ldr x1, =PrimaryCoreMpid
69 ASM_PFX(ArmPlatformPeiBootAction):
70 // The trusted firmware passes the primary CPU MPID through x0 register.
71 // Save it in a variable.
72 ldr x1, =PrimaryCoreMpid