1#
2#  Copyright (c) 2011-2013, ARM Limited. All rights reserved.
3#
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
8#
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.
11#
12#
13
14#include <AsmMacroIoLib.h>
15#include <Library/ArmLib.h>
16
17.text
18.align 2
19
20GCC_ASM_EXPORT(ArmPlatformPeiBootAction)
21GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
22GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)
23GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
24
25GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore)
26GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask)
27
28//UINTN
29//ArmPlatformGetPrimaryCoreMpId (
30//  VOID
31//  );
32ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
33  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
34  ldr   r0, [r0]
35  bx    lr
36
37//UINTN
38//ArmPlatformIsPrimaryCore (
39//  IN UINTN MpId
40//  );
41ASM_PFX(ArmPlatformIsPrimaryCore):
42  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1)
43  ldr   r1, [r1]
44  and   r0, r0, r1
45  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1)
46  ldr   r1, [r1]
47  cmp   r0, r1
48  moveq r0, #1
49  movne r0, #0
50  bx    lr
51
52//UINTN
53//ArmPlatformGetCorePosition (
54//  IN UINTN MpId
55//  );
56ASM_PFX(ArmPlatformGetCorePosition):
57  and   r0, r0, #ARM_CORE_MASK
58  bx    lr
59
60ASM_PFX(ArmPlatformPeiBootAction):
61  bx    lr
62
63ASM_FUNCTION_REMOVE_IF_UNREFERENCED
64