]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
ArmVirtPkg: clean up assembly source files
[mirror_edk2.git] / ArmVirtPkg / Library / ArmQemuRelocatablePlatformLib / AARCH64 / RelocatableVirtHelper.S
index 27ad07a1a1976bfb7fb98e0e617037bb0e9a084d..ec6955cf0af81165f4979fe67f8ee8cc6008adee 100644 (file)
@@ -1,5 +1,6 @@
 #\r
 #  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+#  Copyright (c) 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 <AsmMacroIoLibV8.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
-.LArm64LinuxMagic:\r
-  .byte   0x41, 0x52, 0x4d, 0x64\r
 \r
 // VOID\r
 // ArmPlatformPeiBootAction (\r
 //   VOID   *DeviceTreeBaseAddress,   // passed by loader in x0\r
 //   VOID   *ImageBase                // passed by FDF trampoline in x1\r
 //   );\r
-ASM_PFX(ArmPlatformPeiBootAction):\r
+ASM_FUNC(ArmPlatformPeiBootAction)\r
   //\r
   // If we are booting from RAM using the Linux kernel boot protocol, x0 will\r
   // point to the DTB image in memory. Otherwise, use the default value defined\r
@@ -104,20 +86,22 @@ ASM_PFX(ArmPlatformPeiBootAction):
 .Lout:\r
   ret    x29\r
 \r
+.LArm64LinuxMagic:\r
+  .byte   0x41, 0x52, 0x4d, 0x64\r
+\r
 //UINTN\r
 //ArmPlatformGetPrimaryCoreMpId (\r
 //  VOID\r
 //  );\r
-ASM_PFX(ArmPlatformGetPrimaryCoreMpId):\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, x0)\r
-  ldrh   w0, [x0]\r
+ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)\r
+  MOV32  (w0, FixedPcdGet32 (PcdArmPrimaryCore))\r
   ret\r
 \r
 //UINTN\r
 //ArmPlatformIsPrimaryCore (\r
 //  IN UINTN MpId\r
 //  );\r
-ASM_PFX(ArmPlatformIsPrimaryCore):\r
+ASM_FUNC(ArmPlatformIsPrimaryCore)\r
   mov   x0, #1\r
   ret\r
 \r
@@ -126,7 +110,7 @@ ASM_PFX(ArmPlatformIsPrimaryCore):
 //  IN UINTN MpId\r
 //  );\r
 // With this function: CorePos = (ClusterId * 4) + CoreId\r
-ASM_PFX(ArmPlatformGetCorePosition):\r
+ASM_FUNC(ArmPlatformGetCorePosition)\r
   and   x1, x0, #ARM_CORE_MASK\r
   and   x0, x0, #ARM_CLUSTER_MASK\r
   add   x0, x1, x0, LSR #6\r
@@ -136,7 +120,7 @@ ASM_PFX(ArmPlatformGetCorePosition):
 //GetPhysAddrTop (\r
 //  VOID\r
 //  );\r
-ASM_PFX(ArmGetPhysAddrTop):\r
+ASM_FUNC(ArmGetPhysAddrTop)\r
   mrs   x0, id_aa64mmfr0_el1\r
   adr   x1, .LPARanges\r
   and   x0, x0, #7\r