From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 653591A1E3D for ; Thu, 11 Aug 2016 03:09:05 -0700 (PDT) Received: by mail-wm0-x233.google.com with SMTP id q128so20224349wma.1 for ; Thu, 11 Aug 2016 03:09:05 -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=sSN2xQvVBEoSFD1re3/VD1yBnbv4H1uLp7gBAjrdwts=; b=ErpaGizkENhL+fW4KP7WBJv8bnQsZw0WrFMXVz8+C9zvQPEhF3rKuSaACXiPdL4tXi WCrQAr0V9+mD/CaF+e5qPas0vg1jZDylVJcAa4bnlaR0BXCbq/pTDvLFjfUPBAHqjs22 vCKCbWTE58jBPAPc11iQD43lDkoOqnugrOn7E= 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=sSN2xQvVBEoSFD1re3/VD1yBnbv4H1uLp7gBAjrdwts=; b=AmY36jQWOInV7H3ubXBggVYbvz6rHfomchOqLqJpTXCMdl2l/lDHcvo56IS/2AG8dd ivEo/6V8RXGqY+nrZRSK5Y1o2g38U8q83l5qqZ5psxrPBHhDwiWnMjP+MeVZ5ItVltQv CFwPFsG0wCw3jPN7WKsO6aPU03twKSxhnB9wpnpSIerVcTC1CkPEJepYzrF8RL1WlZdN kpNI/F7bD6OjiMEDAgYIRzKCu8HKjNDVXoOFKrEXj4OcimvBVcmPkS5d4jd6mndtH/w2 FFPtI0d0Yx3L29tDirXZAoXQEdEb8JbEEoMrXuPWsCTO1PRQxvzAwD1n3A+2gB02UdML oBcA== X-Gm-Message-State: AEkoouvFIb7KuNQ+zj2RVsUl3yQGh/5oZ6KcSRZG930nziqLbzQJqjM0RULadpiJS5NklFUM X-Received: by 10.28.169.203 with SMTP id s194mr8386335wme.95.1470910143783; Thu, 11 Aug 2016 03:09:03 -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.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Aug 2016 03:09:03 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Cc: Ard Biesheuvel Date: Thu, 11 Aug 2016 12:08:20 +0200 Message-Id: <1470910101-20322-6-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: [PATCH 5/6] Platforms/Hisilicon/ArmPlatformLibPv660: 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 10:09:05 -0000 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 --- Chips/Hisilicon/Library/ArmPlatformLibPv660/AArch64/Helper.S | 44 +++++--------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/Chips/Hisilicon/Library/ArmPlatformLibPv660/AArch64/Helper.S b/Chips/Hisilicon/Library/ArmPlatformLibPv660/AArch64/Helper.S index 3b545f188f64..3422df279c73 100644 --- a/Chips/Hisilicon/Library/ArmPlatformLibPv660/AArch64/Helper.S +++ b/Chips/Hisilicon/Library/ArmPlatformLibPv660/AArch64/Helper.S @@ -16,59 +16,35 @@ // #include -#include #include -#include -#include -.text -.align 2 - -GCC_ASM_EXPORT(ArmPlatformPeiBootAction) -GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore) -GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId) -GCC_ASM_EXPORT(ArmPlatformGetCorePosition) -GCC_ASM_EXPORT(ArmGetCpuCountPerCluster) - -GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore) -GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask) -GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdCoreCount) - -ASM_PFX(ArmPlatformPeiBootAction): +ASM_FUNC(ArmPlatformPeiBootAction) ret //UINTN //ArmPlatformGetPrimaryCoreMpId ( // VOID // ); -ASM_PFX(ArmPlatformGetPrimaryCoreMpId): - LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, x0) - ldrh w0, [x0] +ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) + MOV32 (w0, FixedPcdGet32(PcdArmPrimaryCore)) ret # IN None # OUT x0 = number of cores present in the system -ASM_PFX(ArmGetCpuCountPerCluster): - LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, x0) - ldrh w0, [x0] +ASM_FUNC(ArmGetCpuCountPerCluster) + MOV32 (w0, FixedPcdGet32(PcdCoreCount)) 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 - b.ne 1f - mov x0, #1 - ret -1: - mov x0, #0 + cset x0, eq ret //UINTN @@ -76,7 +52,7 @@ ASM_PFX(ArmPlatformIsPrimaryCore): // 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 -- 2.7.4