From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 2317A1A1DF3 for ; Thu, 11 Aug 2016 01:37:55 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id f65so15844888wmi.0 for ; Thu, 11 Aug 2016 01:37:55 -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=8yW1XxzAcqO+Pq0VqjfJFLkTIVs+eexpte1oujP6pvg=; b=ZBWEPNClOR4jzJ7yYicRp8f+3RkLa8ThsmC/dTzlhJqw1scFE8s/g28ORnXytKQ/uZ TQnfKDvRW6gIKHKsfxbp0QgJ0tOHVLNNQzheNlStbtcAlPxiFskgqS4Ci1VnX+pbSZSP LPZQpLG95vSrVhwuzKBnVfZkarAvCDdMlsyDI= 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=8yW1XxzAcqO+Pq0VqjfJFLkTIVs+eexpte1oujP6pvg=; b=jxn/wNH0IUNBRrsdGV6jQ5bStJiMtquG2ezggbXbsdCikIFHWer85nDSWwUquyf25K ju07aN2l4M8YzF17eNhX3+PaTbVCEXHvv5xbMkVStFF3kX4fc4MikQJq/9rkkvjW6aZt Q1QwjUq60OupAEcj/lOzc48YuZv6zV2mY9zAbhzQjIDJfjZ8iIJNKBxRrcV62suf5TpR Gb1xGFhk8JDmX4d0W9BE4WkwVPfGXUW2HcWEd/GNY2mmSks2ZuchxPCrvOf3e4Yhr+K/ ZWktEaMyYAmaU3Ew1C7hGY3WHhYCgMGQbTzUtHm5lyhKw3Wh9KIXiMfh7mGtRtAba+hq iW7g== X-Gm-Message-State: AEkoouucb8GDg4M3wyJAsg1kuMDTefZZERmNvh6O0cv9cM5lShgeNDqJ+OLHsl5aItx5DCG/ X-Received: by 10.28.111.4 with SMTP id k4mr8432222wmc.94.1470904673660; Thu, 11 Aug 2016 01:37:53 -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 r67sm2020702wmb.14.2016.08.11.01.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 01:37:53 -0700 (PDT) Date: Thu, 11 Aug 2016 09:37:51 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, eugene@hp.com, lersek@redhat.com Message-ID: <20160811083751.GP31760@bivouac.eciton.net> References: <1470842282-8415-1-git-send-email-ard.biesheuvel@linaro.org> <1470842282-8415-22-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1470842282-8415-22-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 21/26] ArmPlatformPkg/ArmJunoLib: 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:37:55 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Aug 10, 2016 at 05:17:57PM +0200, Ard Biesheuvel wrote: > Annotate functions with ASM_FUNC() so that they are emitted into > separate sections. Also replacing LoadConstantToReg. Add that to commit message and: Reviewed-by: Leif Lindholm > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > --- > ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/AArch64/ArmJunoHelper.S | 37 ++++++-------------- > ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/Arm/ArmJunoHelper.S | 36 ++++++------------- > 2 files changed, 21 insertions(+), 52 deletions(-) > > diff --git a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/AArch64/ArmJunoHelper.S b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/AArch64/ArmJunoHelper.S > index 73b249ca5ffd..4bdf08d1a98a 100644 > --- a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/AArch64/ArmJunoHelper.S > +++ b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/AArch64/ArmJunoHelper.S > @@ -15,25 +15,12 @@ > #include > #include > > -.text > -.align 3 > - > -GCC_ASM_EXPORT(ArmPlatformPeiBootAction) > -GCC_ASM_EXPORT(ArmPlatformGetCorePosition) > -GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId) > -GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore) > - > -GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask) > - > - > -PrimaryCoreMpid: .word 0x0 > - > //UINTN > //ArmPlatformGetCorePosition ( > // IN UINTN MpId > // ); > // With this function: CorePos = (ClusterId * 2) + CoreId > -ASM_PFX(ArmPlatformGetCorePosition): > +ASM_FUNC(ArmPlatformGetCorePosition) > and x1, x0, #ARM_CORE_MASK > and x0, x0, #ARM_CLUSTER_MASK > add x0, x1, x0, LSR #7 > @@ -43,33 +30,29 @@ ASM_PFX(ArmPlatformGetCorePosition): > //ArmPlatformGetPrimaryCoreMpId ( > // VOID > // ); > -ASM_PFX(ArmPlatformGetPrimaryCoreMpId): > - ldr x0, =PrimaryCoreMpid > - ldrh w0, [x0] > +ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) > + ldr w0, PrimaryCoreMpid > ret > > //UINTN > //ArmPlatformIsPrimaryCore ( > // IN UINTN MpId > // ); > -ASM_PFX(ArmPlatformIsPrimaryCore): > - LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, x1) > - ldrh w1, [x1] > +ASM_FUNC(ArmPlatformIsPrimaryCore) > + MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask)) > and x0, x0, x1 > > - ldr x1, =PrimaryCoreMpid > - ldrh w1, [x1] > + ldr w1, PrimaryCoreMpid > > cmp w0, w1 > - mov x0, #1 > - mov x1, #0 > - csel x0, x0, x1, eq > + cset x0, eq > ret > > -ASM_PFX(ArmPlatformPeiBootAction): > +ASM_FUNC(ArmPlatformPeiBootAction) > // The trusted firmware passes the primary CPU MPID through x0 register. > // Save it in a variable. > - ldr x1, =PrimaryCoreMpid > + adr x1, PrimaryCoreMpid > str w0, [x1] > ret > > +PrimaryCoreMpid: .word 0x0 > diff --git a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/Arm/ArmJunoHelper.S b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/Arm/ArmJunoHelper.S > index 2efb5451b88b..a7e904eac697 100644 > --- a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/Arm/ArmJunoHelper.S > +++ b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/Arm/ArmJunoHelper.S > @@ -12,22 +12,9 @@ > * > **/ > > -#include > +#include > #include > > -.text > -.align 3 > - > -GCC_ASM_EXPORT(ArmPlatformPeiBootAction) > -GCC_ASM_EXPORT(ArmPlatformGetCorePosition) > -GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId) > -GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore) > - > -GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask) > - > - > -PrimaryCoreMpid: .word 0x0 > - > // > // Return the core position from the value of its MpId register > // > @@ -41,7 +28,7 @@ PrimaryCoreMpid: .word 0x0 > // IN UINTN MpId > // ); > // With this function: CorePos = (ClusterId * 2) + CoreId > -ASM_PFX(ArmPlatformGetCorePosition): > +ASM_FUNC(ArmPlatformGetCorePosition) > and r1, r0, #ARM_CORE_MASK > and r0, r0, #ARM_CLUSTER_MASK > add r0, r1, r0, LSR #7 > @@ -59,9 +46,8 @@ ASM_PFX(ArmPlatformGetCorePosition): > //ArmPlatformGetPrimaryCoreMpId ( > // VOID > // ); > -ASM_PFX(ArmPlatformGetPrimaryCoreMpId): > - ldr r0, =PrimaryCoreMpid > - ldr r0, [r0] > +ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) > + LDRL (r0, PrimaryCoreMpid) > bx lr > > // > @@ -77,13 +63,11 @@ ASM_PFX(ArmPlatformGetPrimaryCoreMpId): > //ArmPlatformIsPrimaryCore ( > // IN UINTN MpId > // ); > -ASM_PFX(ArmPlatformIsPrimaryCore): > - LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1) > - ldr r1, [r1] > +ASM_FUNC(ArmPlatformIsPrimaryCore) > + MOV32 (r1, FixedPcdGet32 (PcdArmPrimaryCoreMask)) > and r0, r0, r1 > > - ldr r1, =PrimaryCoreMpid > - ldr r1, [r1] > + LDRL (r1, PrimaryCoreMpid) > > cmp r0, r1 > moveq r0, #1 > @@ -97,9 +81,11 @@ ASM_PFX(ArmPlatformIsPrimaryCore): > // or PrePeiCore modules. It allows to retrieve arguments passed to > // the UEFI firmware through the CPU registers. > // > -ASM_PFX(ArmPlatformPeiBootAction): > +ASM_FUNC(ArmPlatformPeiBootAction) > // The trusted firmware passes the primary CPU MPID through r0 register. > // Save it in a variable. > - ldr r1, =PrimaryCoreMpid > + adr r1, PrimaryCoreMpid > str r0, [r1] > bx lr > + > +PrimaryCoreMpid: .word 0x0 > -- > 2.7.4 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel