From nobody Sat Nov 2 12:20:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 14894827066391018.6464438188915; Tue, 14 Mar 2017 02:11:46 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 896E2803DB; Tue, 14 Mar 2017 02:11:45 -0700 (PDT) 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) 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 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 X-Original-To: edk2-devel@lists.01.org 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==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,162,1486454400"; d="scan'208";a="75165962" From: Star Zeng To: edk2-devel@lists.01.org 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: [edk2] [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: , Cc: Feng Tian , Jiewen Yao , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D370 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 Reviewed-by: jiewen.yao@intel.com --- MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c b/MdeModulePk= g/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. =20 - 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 BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -77,11 +77,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DA= TA mSmramProfileContext =3D }; GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA *mSmramProfileCo= ntextPtr =3D NULL; =20 -BOOLEAN mSmramReadyToLock; -BOOLEAN mSmramProfileGettingStatus =3D FALSE; -BOOLEAN mSmramProfileRecordingEnable =3D MEMORY_PROFILE_RECORDING_DISABLE; -EFI_DEVICE_PATH_PROTOCOL *mSmramProfileDriverPath; -UINTN mSmramProfileDriverPathSize; +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramReadyToLock; +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramProfileGettingStatus =3D FALSE; +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramProfileRecordingEnable =3D MEM= ORY_PROFILE_RECORDING_DISABLE; +GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_PROTOCOL *mSmramProfileDrive= rPath; +GLOBAL_REMOVE_IF_UNREFERENCED UINTN mSmramProfileDriver= PathSize; =20 /** Dump SMRAM infromation. @@ -232,7 +232,7 @@ SmramProfileProtocolRecord ( IN CHAR8 *ActionString OPTIONAL ); =20 -EDKII_SMM_MEMORY_PROFILE_PROTOCOL mSmmProfileProtocol =3D { +GLOBAL_REMOVE_IF_UNREFERENCED EDKII_SMM_MEMORY_PROFILE_PROTOCOL mSmmProfil= eProtocol =3D { SmramProfileProtocolGetData, SmramProfileProtocolRegisterImage, SmramProfileProtocolUnregisterImage, @@ -2630,7 +2630,7 @@ typedef struct { CHAR8 *String; } ACTION_STRING; =20 -ACTION_STRING mExtActionString[] =3D { +GLOBAL_REMOVE_IF_UNREFERENCED ACTION_STRING mExtActionString[] =3D { {MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES, "Lib:Alloc= atePages"}, {MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES, "Lib:Alloc= ateRuntimePages"}, {MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES, "Lib:Alloc= ateReservedPages"}, @@ -2654,8 +2654,6 @@ ACTION_STRING mExtActionString[] =3D { {MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL, "Lib:Reall= ocateReservedPool"}, }; =20 -GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mUserDefinedActionString[] =3D {"UserD= efined-0x80000000"}; - typedef struct { EFI_MEMORY_TYPE MemoryType; CHAR8 *MemoryTypeStr; --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel