//\r
\r
#include <AsmMacroIoLibV8.h>\r
-#include <Base.h>\r
-#include <AutoGen.h>\r
-\r
-.text\r
-.align 3\r
-\r
-GCC_ASM_EXPORT(ArmPlatformStackSet)\r
-GCC_ASM_EXPORT(ArmPlatformStackSetPrimary)\r
-GCC_ASM_EXPORT(ArmPlatformStackSetSecondary)\r
-\r
-GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore)\r
-GCC_ASM_IMPORT(ArmPlatformGetCorePosition)\r
-GCC_ASM_IMPORT(ArmPlatformGetPrimaryCoreMpId)\r
-\r
-GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount)\r
\r
//VOID\r
//ArmPlatformStackSet (\r
// IN UINTN PrimaryStackSize,\r
// IN UINTN SecondaryStackSize\r
// );\r
-ASM_PFX(ArmPlatformStackSet):\r
+ASM_FUNC(ArmPlatformStackSet)\r
// Save parameters\r
mov x6, x3\r
mov x5, x2\r
// Restore the Link register\r
mov x30, x7\r
\r
- // Should be ASM_PFX(ArmPlatformStackSetPrimary) but generate linker error 'unsupported ELF EM_AARCH64'\r
- b.eq ArmPlatformStackSetPrimaryL\r
- // Should be ASM_PFX(ArmPlatformStackSetSecondary) but generate linker error 'unsupported ELF EM_AARCH64'\r
- b.ne ArmPlatformStackSetSecondaryL\r
+ b.ne 0f\r
+\r
+ b ASM_PFX(ArmPlatformStackSetPrimary)\r
+0:b ASM_PFX(ArmPlatformStackSetSecondary)\r
\r
//VOID\r
//ArmPlatformStackSetPrimary (\r
// IN UINTN PrimaryStackSize,\r
// IN UINTN SecondaryStackSize\r
// );\r
-ArmPlatformStackSetPrimaryL:\r
-ASM_PFX(ArmPlatformStackSetPrimary):\r
+ASM_FUNC(ArmPlatformStackSetPrimary)\r
// Save the Link register\r
mov x4, x30\r
\r
add x0, x0, x2\r
\r
// Compute SecondaryCoresCount * SecondaryCoreStackSize\r
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, x1)\r
- ldr w1, [x1]\r
- sub x1, x1, #1\r
+ MOV32 (w1, FixedPcdGet32(PcdCoreCount) - 1)\r
mul x3, x3, x1\r
\r
// Set Primary Stack ((StackBase + PrimaryStackSize) + (SecondaryCoresCount * SecondaryCoreStackSize))\r
// IN UINTN PrimaryStackSize,\r
// IN UINTN SecondaryStackSize\r
// );\r
-ArmPlatformStackSetSecondaryL:\r
-ASM_PFX(ArmPlatformStackSetSecondary):\r
+ASM_FUNC(ArmPlatformStackSetSecondary)\r
// Save the Link register\r
mov x4, x30\r
mov sp, x0\r
//\r
\r
#include <AsmMacroIoLib.h>\r
-#include <Base.h>\r
-#include <AutoGen.h>\r
-\r
-.text\r
-.align 3\r
-\r
-GCC_ASM_EXPORT(ArmPlatformStackSet)\r
-GCC_ASM_EXPORT(ArmPlatformStackSetPrimary)\r
-GCC_ASM_EXPORT(ArmPlatformStackSetSecondary)\r
-\r
-GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore)\r
-GCC_ASM_IMPORT(ArmPlatformGetCorePosition)\r
-GCC_ASM_IMPORT(ArmPlatformGetPrimaryCoreMpId)\r
-\r
-GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount)\r
\r
//VOID\r
//ArmPlatformStackSet (\r
// IN UINTN PrimaryStackSize,\r
// IN UINTN SecondaryStackSize\r
// );\r
-ASM_PFX(ArmPlatformStackSet):\r
+ASM_FUNC(ArmPlatformStackSet)\r
// Save parameters\r
mov r6, r3\r
mov r5, r2\r
// IN UINTN PrimaryStackSize,\r
// IN UINTN SecondaryStackSize\r
// );\r
-ASM_PFX(ArmPlatformStackSetPrimary):\r
+ASM_FUNC(ArmPlatformStackSetPrimary)\r
mov r4, lr\r
\r
// Add stack of primary stack to StackBase\r
add r0, r0, r2\r
\r
// Compute SecondaryCoresCount * SecondaryCoreStackSize\r
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, r1)\r
- ldr r1, [r1]\r
- sub r1, #1\r
+ MOV32 (r1, FixedPcdGet32(PcdCoreCount) - 1)\r
mul r3, r3, r1\r
\r
// Set Primary Stack ((StackBase + PrimaryStackSize) + (SecondaryCoresCount * SecondaryCoreStackSize))\r
// IN UINTN PrimaryStackSize,\r
// IN UINTN SecondaryStackSize\r
// );\r
-ASM_PFX(ArmPlatformStackSetSecondary):\r
+ASM_FUNC(ArmPlatformStackSetSecondary)\r
mov r4, lr\r
mov sp, r0\r
\r