]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
ArmVirtPkg: clean up assembly source files
[mirror_edk2.git] / ArmVirtPkg / Library / ArmXenRelocatablePlatformLib / ARM / RelocatableVirtHelper.S
index 539426f36f503f22b2a442637d4feddbf8ae81f6..f264fa1cf731fdf64c0668949e46aaac0dd1e6b4 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
   mov   r11, r14            // preserve LR\r
   mov   r10, r0             // preserve DTB pointer\r
   mov   r9, r1              // preserve base of image pointer\r
@@ -63,8 +44,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
@@ -78,8 +59,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
@@ -90,7 +71,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
@@ -101,20 +82,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
@@ -123,7 +106,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
@@ -133,7 +116,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