From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (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 C87DC1A1E2C for ; Wed, 10 Aug 2016 08:19:13 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id o80so111044696wme.1 for ; Wed, 10 Aug 2016 08:19:13 -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=xat7bXuMUiAujDOCUP5YOh+WIhhoT+sQZfX9cTt5Bwc=; b=i6RzoDVybhdwzSczxtl1p9TLLxtZsYKcnqZeQIwS3Av5T0GSR/hjO5egQKmi411KNq i7Ze2qSUQjbsbpJaLWFgveY7+b4v1l98ocoVlwH6tGy1bCAWjnlTJyHdN+tJBZ+s8ZDV CFqG0O++OqoCJSEiBVH8P0wIQSuXIHOKoz/fI= 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=xat7bXuMUiAujDOCUP5YOh+WIhhoT+sQZfX9cTt5Bwc=; b=YyrNwEiG4TBxoZmPebe99XUZugDqO/BRiG+Fl5poO926TLNyHF0kqyRZQGlyoHejd7 1imqjQ1K5KO7Qiw2VK7QBVLyioghuBeGqjpXOIPM75hXO7nUNivqjgQt5NmO3phyfvS4 Jq20B/K2GQI6zr81Y9TEMc7MAk2Up1atfc69NqD7iJlvU40eLi6hRpNaPY0gU0FRW6bi mJ1+0Tc+MwMUJOzq8savCdcicWAEjdr2wY6CC89lsffdTtgxaydWbG+ZZg5bRDuU/+CJ PvbnO9DzFHNWcFOqRM+uys/SRryh6sx40q8PLU3wWDCdk3L5p1WdULrVEDAMzL7Zix7w mKfQ== X-Gm-Message-State: AEkoousMvSIYwchokCJXYU/Oc605UYEpgNScm0s5zS7sSutwe6ljArXGTG9cl1GabWx+siPZ X-Received: by 10.28.35.193 with SMTP id j184mr3646340wmj.33.1470842352172; Wed, 10 Aug 2016 08:19:12 -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 c16sm8908374wme.4.2016.08.10.08.19.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Aug 2016 08:19:11 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, eugene@hp.com Cc: lersek@redhat.com, Ard Biesheuvel Date: Wed, 10 Aug 2016 17:18:01 +0200 Message-Id: <1470842282-8415-26-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470842282-8415-1-git-send-email-ard.biesheuvel@linaro.org> References: <1470842282-8415-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [PATCH 25/26] ArmPlatformPkg/ArmPlatformLibNull: 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: Wed, 10 Aug 2016 15:19:14 -0000 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/ArmPlatformLibNull/AArch64/ArmPlatformHelper.S | 28 +++++--------------- ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S | 28 +++++--------------- 2 files changed, 14 insertions(+), 42 deletions(-) diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/AArch64/ArmPlatformHelper.S b/ArmPlatformPkg/Library/ArmPlatformLibNull/AArch64/ArmPlatformHelper.S index 8c099b469e0e..2f4cf95cbf13 100644 --- a/ArmPlatformPkg/Library/ArmPlatformLibNull/AArch64/ArmPlatformHelper.S +++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/AArch64/ArmPlatformHelper.S @@ -14,18 +14,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 @@ -33,7 +22,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 @@ -43,21 +32,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 diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S index e52ea5afa2cb..bd517e6e16c1 100644 --- a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S +++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S @@ -14,25 +14,14 @@ #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) bx lr //UINTN //ArmPlatformGetCorePosition ( // IN UINTN MpId // ); -ASM_PFX(ArmPlatformGetCorePosition): +ASM_FUNC(ArmPlatformGetCorePosition) and r1, r0, #ARM_CORE_MASK and r0, r0, #ARM_CLUSTER_MASK add r0, r1, r0, LSR #7 @@ -42,21 +31,18 @@ ASM_PFX(ArmPlatformGetCorePosition): //ArmPlatformGetPrimaryCoreMpId ( // VOID // ); -ASM_PFX(ArmPlatformGetPrimaryCoreMpId): - LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0) - ldr r0, [r0] +ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) + MOV32 (r0, FixedPcdGet32 (PcdArmPrimaryCore)) bx lr //UINTN //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 - LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1) - ldr r1, [r1] + MOV32 (r1, FixedPcdGet32 (PcdArmPrimaryCore)) cmp r0, r1 moveq r0, #1 movne r0, #0 -- 2.7.4