]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
ArmVirtPkg: clean up assembly source files
[mirror_edk2.git] / ArmVirtPkg / Library / ArmQemuRelocatablePlatformLib / ARM / RelocatableVirtHelper.S
index 097038806ecd5578c0d28a1b5ca60d3c8dbf6c57..27af98970c1634de5b6475eb874f1b4d46002ef5 100644 (file)
@@ -1,6 +1,6 @@
 #\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
   //\r
   // If we are booting from RAM using the Linux kernel boot protocol, r0 will\r
   // point to the DTB image in memory. Otherwise, use the default value defined\r
@@ -42,7 +23,7 @@ ASM_PFX(ArmPlatformPeiBootAction):
   //\r
   teq   r0, #0\r
   bne   0f\r
-  ldr   r0, =PcdGet64 (PcdDeviceTreeInitialBaseAddress)\r
+  LDRL  (r0, PcdGet64 (PcdDeviceTreeInitialBaseAddress))\r
 \r
 0:mov   r11, r14            // preserve LR\r
   mov   r10, r0             // preserve DTB pointer\r
@@ -64,8 +45,8 @@ ASM_PFX(ArmPlatformPeiBootAction):
   // 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
@@ -79,8 +60,8 @@ ASM_PFX(ArmPlatformPeiBootAction):
   // 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
@@ -91,7 +72,7 @@ ASM_PFX(ArmPlatformPeiBootAction):
   // 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
@@ -102,20 +83,22 @@ ASM_PFX(ArmPlatformPeiBootAction):
 .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
@@ -124,7 +107,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   r1, r0, #ARM_CORE_MASK\r
   and   r0, r0, #ARM_CLUSTER_MASK\r
   add   r0, r1, r0, LSR #6\r
@@ -134,8 +117,7 @@ ASM_PFX(ArmPlatformGetCorePosition):
 //GetPhysAddrTop (\r
 //  VOID\r
 //  );\r
-ASM_PFX(ArmGetPhysAddrTop):\r
+ASM_FUNC(ArmGetPhysAddrTop)\r
   mov   r0, #0x00000000\r
   mov   r1, #0x10000\r
   bx    lr\r
-\r