On Wed, Aug 10, 2016 at 05:18:02PM +0200, Ard Biesheuvel wrote: > Annotate functions with ASM_FUNC() so that they are emitted into > separate sections. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel <[email protected]> > --- > ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S | > 35 +++++--------------- > ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S | > 25 +++----------- > 2 files changed, 12 insertions(+), 48 deletions(-) > > diff --git > a/ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S > b/ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S > index 485017f62013..65d7d6c6d686 100644 > --- a/ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S > +++ b/ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S > @@ -12,21 +12,6 @@ > // > > #include <AsmMacroIoLibV8.h> > -#include <Base.h> > -#include <AutoGen.h> > - > -.text > -.align 3 > - > -GCC_ASM_EXPORT(ArmPlatformStackSet) > -GCC_ASM_EXPORT(ArmPlatformStackSetPrimary) > -GCC_ASM_EXPORT(ArmPlatformStackSetSecondary) > - > -GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore) > -GCC_ASM_IMPORT(ArmPlatformGetCorePosition) > -GCC_ASM_IMPORT(ArmPlatformGetPrimaryCoreMpId) > - > -GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount) > > //VOID > //ArmPlatformStackSet ( > @@ -35,7 +20,7 @@ GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount) > // IN UINTN PrimaryStackSize, > // IN UINTN SecondaryStackSize > // ); > -ASM_PFX(ArmPlatformStackSet): > +ASM_FUNC(ArmPlatformStackSet) > // Save parameters > mov x6, x3 > mov x5, x2 > @@ -59,10 +44,10 @@ ASM_PFX(ArmPlatformStackSet): > // Restore the Link register > mov x30, x7 > > - // Should be ASM_PFX(ArmPlatformStackSetPrimary) but generate linker error > 'unsupported ELF EM_AARCH64' > - b.eq ArmPlatformStackSetPrimaryL > - // Should be ASM_PFX(ArmPlatformStackSetSecondary) but generate linker > error 'unsupported ELF EM_AARCH64'
Worth mentioning removing this hack as well? Other than that - Also replacing LoadConstantToReg. Add that to commit message and: Reviewed-by: Leif Lindholm <[email protected]> > - b.ne ArmPlatformStackSetSecondaryL > + b.ne 0f > + > + b ASM_PFX(ArmPlatformStackSetPrimary) > +0:b ASM_PFX(ArmPlatformStackSetSecondary) > > //VOID > //ArmPlatformStackSetPrimary ( > @@ -71,8 +56,7 @@ ASM_PFX(ArmPlatformStackSet): > // IN UINTN PrimaryStackSize, > // IN UINTN SecondaryStackSize > // ); > -ArmPlatformStackSetPrimaryL: > -ASM_PFX(ArmPlatformStackSetPrimary): > +ASM_FUNC(ArmPlatformStackSetPrimary) > // Save the Link register > mov x4, x30 > > @@ -80,9 +64,7 @@ ASM_PFX(ArmPlatformStackSetPrimary): > add x0, x0, x2 > > // Compute SecondaryCoresCount * SecondaryCoreStackSize > - LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, x1) > - ldr w1, [x1] > - sub x1, x1, #1 > + MOV32 (w1, FixedPcdGet32(PcdCoreCount) - 1) > mul x3, x3, x1 > > // Set Primary Stack ((StackBase + PrimaryStackSize) + > (SecondaryCoresCount * SecondaryCoreStackSize)) > @@ -97,8 +79,7 @@ ASM_PFX(ArmPlatformStackSetPrimary): > // IN UINTN PrimaryStackSize, > // IN UINTN SecondaryStackSize > // ); > -ArmPlatformStackSetSecondaryL: > -ASM_PFX(ArmPlatformStackSetSecondary): > +ASM_FUNC(ArmPlatformStackSetSecondary) > // Save the Link register > mov x4, x30 > mov sp, x0 > diff --git > a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S > b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S > index 96e925981fca..bdd7a27b7cf9 100644 > --- a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S > +++ b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S > @@ -12,21 +12,6 @@ > // > > #include <AsmMacroIoLib.h> > -#include <Base.h> > -#include <AutoGen.h> > - > -.text > -.align 3 > - > -GCC_ASM_EXPORT(ArmPlatformStackSet) > -GCC_ASM_EXPORT(ArmPlatformStackSetPrimary) > -GCC_ASM_EXPORT(ArmPlatformStackSetSecondary) > - > -GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore) > -GCC_ASM_IMPORT(ArmPlatformGetCorePosition) > -GCC_ASM_IMPORT(ArmPlatformGetPrimaryCoreMpId) > - > -GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount) > > //VOID > //ArmPlatformStackSet ( > @@ -35,7 +20,7 @@ GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount) > // IN UINTN PrimaryStackSize, > // IN UINTN SecondaryStackSize > // ); > -ASM_PFX(ArmPlatformStackSet): > +ASM_FUNC(ArmPlatformStackSet) > // Save parameters > mov r6, r3 > mov r5, r2 > @@ -69,16 +54,14 @@ ASM_PFX(ArmPlatformStackSet): > // IN UINTN PrimaryStackSize, > // IN UINTN SecondaryStackSize > // ); > -ASM_PFX(ArmPlatformStackSetPrimary): > +ASM_FUNC(ArmPlatformStackSetPrimary) > mov r4, lr > > // Add stack of primary stack to StackBase > add r0, r0, r2 > > // Compute SecondaryCoresCount * SecondaryCoreStackSize > - LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, r1) > - ldr r1, [r1] > - sub r1, #1 > + MOV32 (r1, FixedPcdGet32(PcdCoreCount) - 1) > mul r3, r3, r1 > > // Set Primary Stack ((StackBase + PrimaryStackSize) + > (SecondaryCoresCount * SecondaryCoreStackSize)) > @@ -93,7 +76,7 @@ ASM_PFX(ArmPlatformStackSetPrimary): > // IN UINTN PrimaryStackSize, > // IN UINTN SecondaryStackSize > // ); > -ASM_PFX(ArmPlatformStackSetSecondary): > +ASM_FUNC(ArmPlatformStackSetSecondary) > mov r4, lr > mov sp, r0 > > -- > 2.7.4 > > _______________________________________________ > edk2-devel mailing list > [email protected] > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

