From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 1054A80370 for ; Tue, 14 Mar 2017 02:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489482704; x=1521018704; h=from:to:cc:subject:date:message-id; bh=iTv8YtVjsokAg68cpVyEc3PcQehPxLD9iFFlGGjAV4k=; b=cYLyqqMMbX1OPg6qDGNTRkq4UEm8N/GqmNTukFXKztb8tzLwW4oHs/Ik aKr/7mAHPrG2+R189l8wZNF40cxjwQ==; Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2017 02:11:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,162,1486454400"; d="scan'208";a="75165962" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.22]) by orsmga005.jf.intel.com with ESMTP; 14 Mar 2017 02:11:42 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Jiewen Yao , Feng Tian Date: Tue, 14 Mar 2017 17:11:41 +0800 Message-Id: <1489482701-94868-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH] MdeModulePkg PiSmmCore: Remove unreferenced symbol for SMRAM profile 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: Tue, 14 Mar 2017 09:11:44 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=370 Use GLOBAL_REMOVE_IF_UNREFERENCED for some SMRAM profile global variables, then their symbols could be removed when SMRAM profile is disabled. Cc: Jiewen Yao Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng --- MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c index dda9f12a7dcd..410e0836fd16 100644 --- a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c +++ b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c @@ -1,7 +1,7 @@ /** @file Support routines for SMRAM profile. - Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -77,11 +77,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA mSmramProfileContext = }; GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA *mSmramProfileContextPtr = NULL; -BOOLEAN mSmramReadyToLock; -BOOLEAN mSmramProfileGettingStatus = FALSE; -BOOLEAN mSmramProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE; -EFI_DEVICE_PATH_PROTOCOL *mSmramProfileDriverPath; -UINTN mSmramProfileDriverPathSize; +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramReadyToLock; +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramProfileGettingStatus = FALSE; +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE; +GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_PROTOCOL *mSmramProfileDriverPath; +GLOBAL_REMOVE_IF_UNREFERENCED UINTN mSmramProfileDriverPathSize; /** Dump SMRAM infromation. @@ -232,7 +232,7 @@ SmramProfileProtocolRecord ( IN CHAR8 *ActionString OPTIONAL ); -EDKII_SMM_MEMORY_PROFILE_PROTOCOL mSmmProfileProtocol = { +GLOBAL_REMOVE_IF_UNREFERENCED EDKII_SMM_MEMORY_PROFILE_PROTOCOL mSmmProfileProtocol = { SmramProfileProtocolGetData, SmramProfileProtocolRegisterImage, SmramProfileProtocolUnregisterImage, @@ -2630,7 +2630,7 @@ typedef struct { CHAR8 *String; } ACTION_STRING; -ACTION_STRING mExtActionString[] = { +GLOBAL_REMOVE_IF_UNREFERENCED ACTION_STRING mExtActionString[] = { {MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES, "Lib:AllocatePages"}, {MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES, "Lib:AllocateRuntimePages"}, {MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES, "Lib:AllocateReservedPages"}, @@ -2654,8 +2654,6 @@ ACTION_STRING mExtActionString[] = { {MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL, "Lib:ReallocateReservedPool"}, }; -GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mUserDefinedActionString[] = {"UserDefined-0x80000000"}; - typedef struct { EFI_MEMORY_TYPE MemoryType; CHAR8 *MemoryTypeStr; -- 2.7.0.windows.1