2 // Copyright (c) 2012, ARM Limited. All rights reserved.
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
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.
14 #include <AsmMacroIoLib.h>
15 #include <Library/ArmLib.h>
20 GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
21 GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
23 GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore)
24 GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask)
27 //ArmPlatformGetCorePosition (
30 ASM_PFX(ArmPlatformGetCorePosition):
31 and r1, r0, #ARM_CORE_MASK
32 and r0, r0, #ARM_CLUSTER_MASK
33 add r0, r1, r0, LSR #7
38 //ArmPlatformIsPrimaryCore (
41 ASM_PFX(ArmPlatformIsPrimaryCore):
42 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1)
45 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1)