From patchwork Thu Aug 11 10:08:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 73732 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp27493qga; Thu, 11 Aug 2016 03:09:19 -0700 (PDT) X-Received: by 10.66.161.132 with SMTP id xs4mr15457719pab.140.1470910150305; Thu, 11 Aug 2016 03:09:10 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id k29si2574775pfk.57.2016.08.11.03.09.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 03:09:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 52AF11A1E3E; Thu, 11 Aug 2016 03:09:09 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 AAD6D1A1E3E for ; Thu, 11 Aug 2016 03:09:07 -0700 (PDT) Received: by mail-wm0-x22d.google.com with SMTP id i5so5114215wmg.0 for ; Thu, 11 Aug 2016 03:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h/SMQUfsWgDT79VEPIhNDeDbNG0M586Qsq8J4yjCTz8=; b=bM8wHVbhkSxvNAcEJTVYG2H5XLe92kBkV7rQCdQtSN7RnfTbhCa7G5hehkoRzS4EGE IM9erK0fHBTccwZFBiR3PS/njfDFErKptZd36cynt+vYAuhYbj3t/FdkK9+BUzyrOhEz kJxZVhvtU6nItmoBlWi/2OMCaBbEOoq34u+fs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h/SMQUfsWgDT79VEPIhNDeDbNG0M586Qsq8J4yjCTz8=; b=WBU8E9Ua+ieF8IMWOTs0AxAGI7FVUlJFeLYyLyOyTeNfR0Z3yjMAqsvkG45t22xxpo Ucasfoz+Mo64NeEjiT8l2JdZFi/GskFOvrAloBeZtF1sLrJ3KrxEluO3nf/7lReycYcN f2VFYSW35QTbMbFITDZ5LDS8jySZnqyBrssTw09qjq0DhJeBKjqmXRlCmXDYmTMaU2aM VaiVujSKnF397LFA9t/kFaSHWGK+GEYCxA0bT4zhwF4XNgTAdU+X0yJyWfXz6qYkX989 AIOrY7Z8zSEJtaXSsKXwI+pNeT424Zhm+NDndjrpK5oIJjSpwMpInqmHGly/GGZpCc9b ejyg== X-Gm-Message-State: AEkoouusScGbn4NJseMatT2n4Cl6gJtH4KXtWAXCOxHES7IdM7u2LTf2GRmrfGXFnKhDr1s3 X-Received: by 10.28.196.14 with SMTP id u14mr7671621wmf.17.1470910145402; Thu, 11 Aug 2016 03:09:05 -0700 (PDT) Received: from localhost.localdomain (46.red-81-37-107.dynamicip.rima-tde.net. [81.37.107.46]) by smtp.gmail.com with ESMTPSA id p83sm2402873wma.18.2016.08.11.03.09.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Aug 2016 03:09:04 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Thu, 11 Aug 2016 12:08:21 +0200 Message-Id: <1470910101-20322-7-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470910101-20322-1-git-send-email-ard.biesheuvel@linaro.org> References: <1470910101-20322-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 6/6] Platforms/Marvell/Armada70x0Lib: 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: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Annotate functions with ASM_FUNC() so that they are emitted into separate sections. While we're at it, clean up some inefficient uses of LoadConstantToReg() (which require runtime relocation). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- Platforms/Marvell/Armada/Library/Armada70x0Lib/AArch64/ArmPlatformHelper.S | 32 +++++--------------- 1 file changed, 8 insertions(+), 24 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platforms/Marvell/Armada/Library/Armada70x0Lib/AArch64/ArmPlatformHelper.S b/Platforms/Marvell/Armada/Library/Armada70x0Lib/AArch64/ArmPlatformHelper.S index 4ad435c9d044..9265636ca5cf 100644 --- a/Platforms/Marvell/Armada/Library/Armada70x0Lib/AArch64/ArmPlatformHelper.S +++ b/Platforms/Marvell/Armada/Library/Armada70x0Lib/AArch64/ArmPlatformHelper.S @@ -15,18 +15,7 @@ #include #include -.text -.align 2 - -GCC_ASM_EXPORT(ArmPlatformPeiBootAction) -GCC_ASM_EXPORT(ArmPlatformGetCorePosition) -GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId) -GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore) - -GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore) -GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask) - -ASM_PFX(ArmPlatformPeiBootAction): +ASM_FUNC(ArmPlatformPeiBootAction) ret //UINTN @@ -34,7 +23,7 @@ ASM_PFX(ArmPlatformPeiBootAction): // IN UINTN MpId // ); // With this function: CorePos = (ClusterId * 4) + CoreId -ASM_PFX(ArmPlatformGetCorePosition): +ASM_FUNC(ArmPlatformGetCorePosition) and x1, x0, #ARM_CORE_MASK and x0, x0, #ARM_CLUSTER_MASK add x0, x1, x0, LSR #6 @@ -44,23 +33,18 @@ ASM_PFX(ArmPlatformGetCorePosition): //ArmPlatformGetPrimaryCoreMpId ( // VOID // ); -ASM_PFX(ArmPlatformGetPrimaryCoreMpId): - LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, x0) - ldrh w0, [x0] +ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) + MOV32 (w0, FixedPcdGet32(PcdArmPrimaryCore)) 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 - LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, x1) - ldrh w1, [x1] + MOV32 (w1, FixedPcdGet32(PcdArmPrimaryCore)) cmp w0, w1 - mov x0, #1 - mov x1, #0 - csel x0, x0, x1, eq + cset x0, eq ret