]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/Library/ArmPlatformLibNull/AArch64/ArmPlatformHelper.S
IntelFsp2Pkg/SplitFspBin.py: Support rebasing 1.x binary.
[mirror_edk2.git] / ArmPlatformPkg / Library / ArmPlatformLibNull / AArch64 / ArmPlatformHelper.S
CommitLineData
1bc83266
HL
1//\r
2// Copyright (c) 2012-2013, ARM Limited. All rights reserved.\r
3//\r
f4dfad05 4// SPDX-License-Identifier: BSD-2-Clause-Patent\r
1bc83266
HL
5//\r
6//\r
7\r
8#include <AsmMacroIoLibV8.h>\r
9#include <Library/ArmLib.h>\r
10\r
c17ae4cf 11ASM_FUNC(ArmPlatformPeiBootAction)\r
1bc83266
HL
12 ret\r
13\r
14//UINTN\r
15//ArmPlatformGetCorePosition (\r
16// IN UINTN MpId\r
17// );\r
18// With this function: CorePos = (ClusterId * 4) + CoreId\r
c17ae4cf 19ASM_FUNC(ArmPlatformGetCorePosition)\r
1bc83266
HL
20 and x1, x0, #ARM_CORE_MASK\r
21 and x0, x0, #ARM_CLUSTER_MASK\r
22 add x0, x1, x0, LSR #6\r
23 ret\r
24\r
25//UINTN\r
26//ArmPlatformGetPrimaryCoreMpId (\r
27// VOID\r
28// );\r
c17ae4cf
AB
29ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)\r
30 MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore))\r
1bc83266
HL
31 ret\r
32\r
33//UINTN\r
34//ArmPlatformIsPrimaryCore (\r
35// IN UINTN MpId\r
36// );\r
c17ae4cf
AB
37ASM_FUNC(ArmPlatformIsPrimaryCore)\r
38 MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask))\r
1bc83266 39 and x0, x0, x1\r
c17ae4cf 40 MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCore))\r
1bc83266
HL
41 cmp w0, w1\r
42 mov x0, #1\r
43 mov x1, #0\r
44 csel x0, x0, x1, eq\r
45 ret\r