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