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>
19 //ArmPlatformGetCorePosition (
22 // With this function: CorePos = (ClusterId * 2) + CoreId
23 ASM_FUNC(ArmPlatformGetCorePosition)
24 and x1, x0, #ARM_CORE_MASK
25 and x0, x0, #ARM_CLUSTER_MASK
26 add x0, x1, x0, LSR #7
30 //ArmPlatformGetPrimaryCoreMpId (
33 ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)
34 ldr w0, PrimaryCoreMpid
38 //ArmPlatformIsPrimaryCore (
41 ASM_FUNC(ArmPlatformIsPrimaryCore)
42 MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask))
45 ldr w1, PrimaryCoreMpid
51 ASM_FUNC(ArmPlatformPeiBootAction)
52 // The trusted firmware passes the primary CPU MPID through x0 register.
53 // Save it in a variable.
54 adr x1, PrimaryCoreMpid
58 PrimaryCoreMpid: .word 0x0