#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# Copyright (c) 2014, Linaro Limited. All rights reserved.\r
+# Copyright (c) 2014-2016, Linaro Limited. All rights reserved.\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
#\r
\r
#include <AsmMacroIoLib.h>\r
-#include <Base.h>\r
#include <Library/ArmLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <AutoGen.h>\r
\r
-.text\r
-.align 2\r
-\r
-GCC_ASM_EXPORT(ArmPlatformPeiBootAction)\r
-GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)\r
-GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)\r
-GCC_ASM_EXPORT(ArmPlatformGetCorePosition)\r
-GCC_ASM_EXPORT(ArmGetPhysAddrTop)\r
-\r
-GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore)\r
-GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask)\r
-GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdCoreCount)\r
-\r
-.LArm32LinuxMagic:\r
- .byte 0x18, 0x28, 0x6f, 0x01\r
-\r
-ASM_PFX(ArmPlatformPeiBootAction):\r
+ASM_FUNC(ArmPlatformPeiBootAction)\r
mov r11, r14 // preserve LR\r
mov r10, r0 // preserve DTB pointer\r
mov r9, r1 // preserve base of image pointer\r
// to the actual relocated value, and add the shift of PcdFdBaseAddress to\r
// PcdFvBaseAddress as well\r
//\r
- ldr r8, =PcdGet64 (PcdFdBaseAddress)\r
- ldr r7, =PcdGet64 (PcdFvBaseAddress)\r
+ ADRL (r8, PcdGet64 (PcdFdBaseAddress))\r
+ ADRL (r7, PcdGet64 (PcdFvBaseAddress))\r
ldr r6, [r8]\r
ldr r5, [r7]\r
sub r5, r5, r6\r
// encountered. Since we are calling a C function, use the window at the\r
// beginning of the FD image as a temp stack.\r
//\r
- ldr r1, =PcdGet64 (PcdSystemMemoryBase)\r
- ldr r2, =PcdGet64 (PcdSystemMemorySize)\r
+ ADRL (r1, PcdGet64 (PcdSystemMemoryBase))\r
+ ADRL (r2, PcdGet64 (PcdSystemMemorySize))\r
mov sp, r5\r
bl FindMemnode\r
teq r0, #0\r
// image header at the base of this image (defined in the FDF), and record the\r
// pointer in PcdDeviceTreeInitialBaseAddress.\r
//\r
- ldr r8, =PcdGet64 (PcdDeviceTreeInitialBaseAddress)\r
+ ADRL (r8, PcdGet64 (PcdDeviceTreeInitialBaseAddress))\r
add r9, r9, #0x40\r
str r9, [r8]\r
\r
.Lout:\r
bx r11\r
\r
+.LArm32LinuxMagic:\r
+ .byte 0x18, 0x28, 0x6f, 0x01\r
+\r
//UINTN\r
//ArmPlatformGetPrimaryCoreMpId (\r
// VOID\r
// );\r
-ASM_PFX(ArmPlatformGetPrimaryCoreMpId):\r
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)\r
- ldr r0, [r0]\r
+ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)\r
+ MOV32 (r0, FixedPcdGet32 (PcdArmPrimaryCore))\r
bx lr\r
\r
//UINTN\r
//ArmPlatformIsPrimaryCore (\r
// IN UINTN MpId\r
// );\r
-ASM_PFX(ArmPlatformIsPrimaryCore):\r
+ASM_FUNC(ArmPlatformIsPrimaryCore)\r
mov r0, #1\r
bx lr\r
\r
// IN UINTN MpId\r
// );\r
// With this function: CorePos = (ClusterId * 4) + CoreId\r
-ASM_PFX(ArmPlatformGetCorePosition):\r
+ASM_FUNC(ArmPlatformGetCorePosition)\r
and r1, r0, #ARM_CORE_MASK\r
and r0, r0, #ARM_CLUSTER_MASK\r
add r0, r1, r0, LSR #6\r
//GetPhysAddrTop (\r
// VOID\r
// );\r
-ASM_PFX(ArmGetPhysAddrTop):\r
+ASM_FUNC(ArmGetPhysAddrTop)\r
mov r0, #0x00000000\r
mov r1, #0x10000\r
bx lr\r