]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.asm
ARM Packages: Replaced the macro GetCorePositionFromMpId() by the ArmPlatformGetCoreP...
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressLibCTA9x4 / CTA9x4Helper.asm
CommitLineData
bebda7ce 1//\r
2// Copyright (c) 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 <AsmMacroIoLib.h>\r
2d45f194 15#include <Library/ArmLib.h>\r
bebda7ce 16\r
17#include <AutoGen.h>\r
18\r
19 INCLUDE AsmMacroIoLib.inc\r
20\r
21 EXPORT ArmPlatformIsPrimaryCore\r
d05ca26c 22 EXPORT ArmPlatformGetPrimaryCoreMpId\r
2d45f194 23 EXPORT ArmPlatformGetCorePosition\r
bebda7ce 24\r
25 IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCore\r
26 IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCoreMask\r
27\r
28 AREA CTA9x4Helper, CODE, READONLY\r
29\r
d05ca26c 30//UINTN\r
31//ArmPlatformGetPrimaryCoreMpId (\r
32// VOID\r
33// );\r
34ArmPlatformGetPrimaryCoreMpId FUNCTION\r
35 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r0)\r
36 ldr r0, [r0]\r
37 bx lr\r
38 ENDFUNC\r
39\r
bebda7ce 40//UINTN\r
41//ArmPlatformIsPrimaryCore (\r
42// IN UINTN MpId\r
43// );\r
44ArmPlatformIsPrimaryCore FUNCTION\r
45 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1)\r
46 ldr r1, [r1]\r
47 and r0, r0, r1\r
48 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1)\r
49 ldr r1, [r1]\r
50 cmp r0, r1\r
51 moveq r0, #1\r
52 movne r0, #0\r
53 bx lr\r
54 ENDFUNC\r
55\r
2d45f194 56//UINTN\r
57//ArmPlatformGetCorePosition (\r
58// IN UINTN MpId\r
59// );\r
60ArmPlatformGetCorePosition FUNCTION\r
61 and r0, r0, #ARM_CORE_MASK\r
62 bx lr\r
63 ENDFUNC\r
64\r
bebda7ce 65 END\r