From patchwork Thu Mar 17 13:20:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63994 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp465160lbc; Thu, 17 Mar 2016 06:22:12 -0700 (PDT) X-Received: by 10.66.146.196 with SMTP id te4mr14773242pab.125.1458220931997; Thu, 17 Mar 2016 06:22:11 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id j3si2612288pap.58.2016.03.17.06.22.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Mar 2016 06:22:11 -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; 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7C6551A1E38; Thu, 17 Mar 2016 06:22:31 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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 9E6BF1A1E23 for ; Thu, 17 Mar 2016 06:22:30 -0700 (PDT) Received: by mail-wm0-x22e.google.com with SMTP id p65so117188167wmp.0 for ; Thu, 17 Mar 2016 06:22:10 -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=JaeOnWN9TJ6XGhSJm1C2MfI2WRzLDsSrCpQIbA5hUks=; b=Kb5uIkDoDJVyKn0+ZPH4pLnVYknqagDExK1ka2aiVyaSwJMflqjDSc8d3Ac8T86wlE fHeNMJQ0RYpysSa5ZGpSB7fy90s/YsS4F7jcpKJWbE0GOuyyzZAfVeYn21pIBC/VEGS/ sFGE2CAeqZI6nYhkDce+0zz/Oq6MiZYWQdxr4= 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=JaeOnWN9TJ6XGhSJm1C2MfI2WRzLDsSrCpQIbA5hUks=; b=ZBE284of6pD6bOlR+phbGmdXVbm8ePolsDN8Pt/Qjz42uXZBgi7cbnBQSytgVNjEr5 e5XD84wYiNFSaSvOvGGHVbgoxwd9je8H2EFHwYGCzSzgdu9VUxug2f/+iTx9HuezOm7q TtLfY1oU8UBE1MAT+rhHuNqaG2YpEevWUNEoxWh65kNL2mPV24lmfQGFVLJnarsqYZ4l Lp93jLzT/0kLPuCGSDK1Fn/pXZS9BHhRF11G3HUm3+5yyn+qulPA0QcWvxOViSnr+C86 67c9tWkmYk2DJd43AwudMWY8ej/0SpylDPEIJId4uVAmHcuPeE9aRWR3DM2XYXzbPhJd xVdw== X-Gm-Message-State: AD7BkJIwumjOkg/hQPvRTq0ctBNEJD53MzY0Oh4jfkDmHc/9sIrkHpa8QhZ7a78Lsi/fW/Hp X-Received: by 10.194.91.205 with SMTP id cg13mr9860132wjb.166.1458220929364; Thu, 17 Mar 2016 06:22:09 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id v5sm30198913wmg.16.2016.03.17.06.22.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 06:22:08 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, eugene@hp.com Date: Thu, 17 Mar 2016 14:20:13 +0100 Message-Id: <1458220815-6944-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458220815-6944-1-git-send-email-ard.biesheuvel@linaro.org> References: <1458220815-6944-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 5/7] ArmPkg/ArmExceptionLib: make build time define visible to the compiler X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The global gArmRelocateVectorTable is a build time constant, but due to its external linkage and lack of constness, the compiler does not see that. So turn it into a static boolean, and at the same time, make the function CopyExceptionHandlers() (which is only called if gArmRelocateVectorTable is set) static as well, so that the compiler can eliminate it completely if we are using the vector table in place. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.5.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c index 5977a3e8fae1..0cf0766b9cbf 100644 --- a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c +++ b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c @@ -26,6 +26,7 @@ #include #include +STATIC RETURN_STATUS CopyExceptionHandlers( IN PHYSICAL_ADDRESS BaseAddress @@ -66,9 +67,9 @@ extern UINTN gDebuggerNoHandlerValue; // library we cannot represent this in a PCD since PCDs are evaluated on // a per-module basis. #if defined(ARM_RELOCATE_VECTORS) -BOOLEAN gArmRelocateVectorTable = TRUE; +STATIC CONST BOOLEAN gArmRelocateVectorTable = TRUE; #else -BOOLEAN gArmRelocateVectorTable = FALSE; +STATIC CONST BOOLEAN gArmRelocateVectorTable = FALSE; #endif @@ -151,6 +152,7 @@ with default exception handlers. @retval EFI_UNSUPPORTED This function is not supported. **/ +STATIC RETURN_STATUS CopyExceptionHandlers( IN PHYSICAL_ADDRESS BaseAddress