]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/AArch64/RTSMHelper.S
ARM Packages: Replace tabs by spaces for indentation
[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
15#include <Base.h>\r
16#include <Library/ArmLib.h>\r
17#include <Library/PcdLib.h>\r
18#include <AutoGen.h>\r
19\r
20.text\r
21.align 2\r
22\r
23GCC_ASM_EXPORT(ArmPlatformPeiBootAction)\r
24GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)\r
99267097 25GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)\r
27be3601
HL
26GCC_ASM_EXPORT(ArmPlatformGetCorePosition)\r
27GCC_ASM_EXPORT(ArmGetCpuCountPerCluster)\r
28\r
29GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore)\r
30GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask)\r
31GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdCoreCount)\r
32\r
33ASM_PFX(ArmPlatformPeiBootAction):\r
34 ret\r
35\r
99267097
OM
36//UINTN\r
37//ArmPlatformGetPrimaryCoreMpId (\r
38// VOID\r
39// );\r
40ASM_PFX(ArmPlatformGetPrimaryCoreMpId):\r
41 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, x0)\r
42 ldrh w0, [x0]\r
43 ret\r
44\r
27be3601
HL
45# IN None\r
46# OUT x0 = number of cores present in the system\r
47ASM_PFX(ArmGetCpuCountPerCluster):\r
48 LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, x0)\r
49 ldrh w0, [x0]\r
50 ret\r
51\r
52//UINTN\r
53//ArmPlatformIsPrimaryCore (\r
54// IN UINTN MpId\r
55// );\r
56ASM_PFX(ArmPlatformIsPrimaryCore):\r
57 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, x1)\r
58 ldrh w1, [x1]\r
59 and x0, x0, x1\r
60 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, x1)\r
61 ldrh w1, [x1]\r
62 cmp w0, w1\r
63 b.ne 1f\r
91c38d4e 64 mov x0, #1\r
27be3601
HL
65 ret\r
661:\r
91c38d4e 67 mov x0, #0\r
27be3601
HL
68 ret\r
69\r
70//UINTN\r
71//ArmPlatformGetCorePosition (\r
72// IN UINTN MpId\r
73// );\r
74// With this function: CorePos = (ClusterId * 4) + CoreId\r
75ASM_PFX(ArmPlatformGetCorePosition):\r
76 and x1, x0, #ARM_CORE_MASK\r
77 and x0, x0, #ARM_CLUSTER_MASK\r
78 add x0, x1, x0, LSR #6\r
79 ret\r
80\r
81ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r