]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/AArch64/RTSMHelper.S
ArmPlatformPkg/ArmVExpressPkg: switch to ASM_FUNC() asm macro
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressLibRTSM / AArch64 / RTSMHelper.S
CommitLineData
27be3601
HL
1#\r
2# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
3#\r
4# This program and the accompanying materials\r
5# are licensed and made available under the terms and conditions of the BSD License\r
6# which accompanies this distribution. The full text of the license may be found at\r
7# http://opensource.org/licenses/bsd-license.php\r
8#\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#\r
12#\r
13\r
14#include <AsmMacroIoLibV8.h>\r
27be3601 15#include <Library/ArmLib.h>\r
27be3601 16\r
04209b53 17ASM_FUNC(ArmPlatformPeiBootAction)\r
27be3601
HL
18 ret\r
19\r
99267097
OM
20//UINTN\r
21//ArmPlatformGetPrimaryCoreMpId (\r
22// VOID\r
23// );\r
04209b53
AB
24ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)\r
25 MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore))\r
99267097
OM
26 ret\r
27\r
27be3601
HL
28# IN None\r
29# OUT x0 = number of cores present in the system\r
04209b53
AB
30ASM_FUNC(ArmGetCpuCountPerCluster)\r
31 MOV32 (w0, FixedPcdGet32 (PcdCoreCount))\r
27be3601
HL
32 ret\r
33\r
34//UINTN\r
35//ArmPlatformIsPrimaryCore (\r
36// IN UINTN MpId\r
37// );\r
04209b53
AB
38ASM_FUNC(ArmPlatformIsPrimaryCore)\r
39 MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask))\r
27be3601 40 and x0, x0, x1\r
04209b53 41 MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCore))\r
27be3601
HL
42 cmp w0, w1\r
43 b.ne 1f\r
91c38d4e 44 mov x0, #1\r
27be3601
HL
45 ret\r
461:\r
91c38d4e 47 mov x0, #0\r
27be3601
HL
48 ret\r
49\r
50//UINTN\r
51//ArmPlatformGetCorePosition (\r
52// IN UINTN MpId\r
53// );\r
54// With this function: CorePos = (ClusterId * 4) + CoreId\r
04209b53 55ASM_FUNC(ArmPlatformGetCorePosition)\r
27be3601
HL
56 and x1, x0, #ARM_CORE_MASK\r
57 and x0, x0, #ARM_CLUSTER_MASK\r
58 add x0, x1, x0, LSR #6\r
59 ret\r
60\r
61ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r