From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E3B8B1A1E4B for ; Thu, 28 Jul 2016 20:26:18 -0700 (PDT) Received: from GaryWorkstation.apac.novell.com (ip-203-192-156-9.asianetcom.net [203.192.156.9]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Fri, 29 Jul 2016 05:26:15 +0200 From: Gary Lin To: edk2-devel@lists.01.org Cc: David Wei Date: Fri, 29 Jul 2016 11:25:28 +0800 Message-Id: <20160729032538.17730-10-glin@suse.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160729032538.17730-1-glin@suse.com> References: <20160729032538.17730-1-glin@suse.com> Subject: [PATCH v2 09/19] Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea 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: Fri, 29 Jul 2016 03:26:19 -0000 mGlobalNvsArea wasn't declared as extern in AcpiPlatform.h and the header was included in AcpiPlatform.c and AcpiPlatformHooks.c. Although it's declared as extern in AcpiPlatformHooks.c, gcc still created an instance of mGlobalNvsArea in AcpiPlatformHooks.c since the header was expanded first and then the linker complained "multiple definition". This commit rearrange the delaration of mGlobalNvsArea to satisfy gcc. Cc: David Wei Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin Reviewed-by: David Wei --- Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 1 + Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h | 2 +- Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c index bb9cee5..70ad07e 100644 --- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c +++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c @@ -66,6 +66,7 @@ CHAR16 gACPIOSFRRefDataBlockVariableName[] = ACPI_OSFR_REF_DATA_BLOCK_VARIABL CHAR16 gACPIOSFRMfgStringVariableName[] = ACPI_OSFR_MFG_STRING_VARIABLE_NAME; EFI_CPU_IO_PROTOCOL *mCpuIo; +EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea; #ifndef __GNUC__ #pragma optimize("", off) #endif diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h index fbc9272..8587beb 100644 --- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h +++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h @@ -59,7 +59,7 @@ Abstract: // // Global variables. // -EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea; +extern EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea; // // ACPI table information used to initialize tables. diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c index c89c07f..2dc9657 100644 --- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c +++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c @@ -33,7 +33,6 @@ Abstract: // #include "AcpiPlatformHooksLib.h" -extern EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea; extern SYSTEM_CONFIGURATION mSystemConfiguration; ENHANCED_SPEEDSTEP_PROTOCOL *mEistProtocol = NULL; -- 2.9.2