]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/ARM/VirtHelper.asm
ArmPlatformPkg/ArmVirtualizationPkg: add ArmVirtualizationPlatformLib library
[mirror_edk2.git] / ArmPlatformPkg / ArmVirtualizationPkg / Library / ArmVirtualizationPlatformLib / ARM / VirtHelper.asm
CommitLineData
a36d531f
MC
1#\r
2# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
3# Copyright (c) 2014, Linaro Limited. All rights reserved.\r
4#\r
5# This program and the accompanying materials\r
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12#\r
13#\r
14\r
15#include <AsmMacroIoLib.h>\r
16#include <Base.h>\r
17#include <Library/ArmLib.h>\r
18#include <Library/PcdLib.h>\r
19#include <AutoGen.h>\r
20\r
21 INCLUDE AsmMacroIoLib.inc\r
22\r
23 EXPORT ArmPlatformPeiBootAction\r
24 EXPORT ArmPlatformIsPrimaryCore\r
25 EXPORT ArmPlatformGetPrimaryCoreMpId\r
26 EXPORT ArmPlatformGetCorePosition\r
27 EXPORT ArmGetPhysAddrTop\r
28\r
29 IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCore\r
30 IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCoreMask\r
31 IMPORT _gPcd_FixedAtBuild_PcdCoreCount\r
32\r
33ArmPlatformPeiBootAction FUNCTION\r
34 bx lr\r
35 ENDFUNC\r
36\r
37//UINTN\r
38//ArmPlatformGetPrimaryCoreMpId (\r
39// VOID\r
40// );\r
41ArmPlatformGetPrimaryCoreMpId FUNCTION\r
42 LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)\r
43 ldr r0, [r0]\r
44 bx lr\r
45 ENDFUNC\r
46\r
47//UINTN\r
48//ArmPlatformIsPrimaryCore (\r
49// IN UINTN MpId\r
50// );\r
51ArmPlatformIsPrimaryCore FUNCTION\r
52 mov r0, #1\r
53 bx lr\r
54 ENDFUNC\r
55\r
56//UINTN\r
57//ArmPlatformGetCorePosition (\r
58// IN UINTN MpId\r
59// );\r
60// With this function: CorePos = (ClusterId * 4) + CoreId\r
61ArmPlatformGetCorePosition FUNCTION\r
62 and r1, r0, #ARM_CORE_MASK\r
63 and r0, r0, #ARM_CLUSTER_MASK\r
64 add r0, r1, r0, LSR #6\r
65 bx lr\r
66 ENDFUNC\r
67\r
68//EFI_PHYSICAL_ADDRESS\r
69//GetPhysAddrTop (\r
70// VOID\r
71// );\r
72ArmGetPhysAddrTop FUNCTION\r
73 mov r0, #0x00000000\r
74 mov r1, #0x10000\r
75 bx lr\r
76 ENDFUNC\r
77\r
78 END\r