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