From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 809B91A1DF3 for ; Thu, 11 Aug 2016 01:42:47 -0700 (PDT) Received: by mail-wm0-x22e.google.com with SMTP id q128so16142030wma.1 for ; Thu, 11 Aug 2016 01:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fcZOYX0WYxnAOXRGJdMj7fCsvlUbv1lmqoCqQv67L+4=; b=ICwVXyZ9CYwejW02rSH/lKYtfEfN7Fch9QUt+bHaSsv1+QfSoJ/8Msn0KKInsl2xGV GcS4R6XQTu+VVHYg9XDR+FT5DcLFy56twQtYmsF2dthPum4q1riC0XoZokpgZIDotnOw Ze2NvKUPTVCpE+T3FsH3JpQjON+3h/ExqrPhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fcZOYX0WYxnAOXRGJdMj7fCsvlUbv1lmqoCqQv67L+4=; b=R/XVQidunBbyCHXXYHK/EOzhVoK1spN1/wf0wzQi+8JJx1nxMxFUoVbMWQIbX+mWr7 +WCvqGBRTlyVw4IZ/y7Su9ODvl/ZC7rL7ybyZicDmo5ffoaQXQ14fP1Lj1imlqWwnHD5 ZTg4vToXL/n5Bz+qrkh+c9zjwIvSD+QI3iOJpa0kqBMrQ120BA7a6vnWzZWmuuRLvqZf PB1ntDxM2jnG1O23WAwKr/Oyk7lXbVEyaifG4D1bk8U1WZtG4GRhcB9iU+AXuAfOjDFI HaFuP0RDuqcSUvdGaD5jZ8Gh111O7Ja6wFG4uTkssuXErTk3Nus/xqge54n7+PQ0u1rA y8nw== X-Gm-Message-State: AEkooutJLOgj8Y/FbPr18xL3xNSlHtoIY27EfKozwrMY1gCVmvo2C3cAWzd7RLJId4ZkW8YM X-Received: by 10.28.27.143 with SMTP id b137mr8454877wmb.12.1470904966069; Thu, 11 Aug 2016 01:42:46 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id t202sm12217684wmt.22.2016.08.11.01.42.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 01:42:45 -0700 (PDT) Date: Thu, 11 Aug 2016 09:42:43 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, eugene@hp.com, lersek@redhat.com Message-ID: <20160811084243.GU31760@bivouac.eciton.net> References: <1470842282-8415-1-git-send-email-ard.biesheuvel@linaro.org> <1470842282-8415-27-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1470842282-8415-27-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 26/26] ArmPlatformPkg/ArmPlatformStackLib: switch to ASM_FUNC() asm macro X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2016 08:42:48 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --- > 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 > -#include > -#include > - > -.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 > - 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 > -#include > -#include > - > -.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 > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel