From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 44749803D5 for ; Tue, 14 Mar 2017 23:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489561180; x=1521097180; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=FZgU2VGUZmmJxjCZXu+NZV4xkvccwZzyZruwEl8VadE=; b=cvUb33T2M39j7GSsc/GoqdoVX6igbcCrCr9emPCVo4YKt+EBujEZeqAW KM5v3/6UBNHHZm8bFs6/n+9iD3uZhg==; Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2017 23:59:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,167,1486454400"; d="scan'208";a="75560185" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 14 Mar 2017 23:59:39 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 14 Mar 2017 23:59:39 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Wed, 15 Mar 2017 14:59:37 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Tian, Feng" Thread-Topic: [PATCH] MdeModulePkg PiSmmCore: Remove unreferenced symbol for SMRAM profile Thread-Index: AQHSnKMIXvBgBJUctEegNPvrgF6fK6GVehdg Date: Wed, 15 Mar 2017 06:59:36 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A904ED6@shsmsx102.ccr.corp.intel.com> References: <1489482701-94868-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1489482701-94868-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Wed, 15 Mar 2017 06:59:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: jiewen.yao@intel.com > -----Original Message----- > From: Zeng, Star > Sent: Tuesday, March 14, 2017 5:12 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen ;= Tian, > Feng > Subject: [PATCH] MdeModulePkg PiSmmCore: Remove unreferenced symbol for > SMRAM profile >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D370 >=20 > Use GLOBAL_REMOVE_IF_UNREFERENCED for some SMRAM profile global > variables, > then their symbols could be removed when SMRAM profile is disabled. >=20 > 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(-) >=20 > 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. >=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 = 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 =3D > }; > GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA > *mSmramProfileContextPtr =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 MEMORY_PROFILE_RECORDING_DISABLE; > +GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_PROTOCOL > *mSmramProfileDriverPath; > +GLOBAL_REMOVE_IF_UNREFERENCED UINTN > mSmramProfileDriverPathSize; >=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 mSmmProfileProtocol =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: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[] =3D { > {MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL, > "Lib:ReallocateReservedPool"}, > }; >=20 > -GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mUserDefinedActionString[] =3D > {"UserDefined-0x80000000"}; > - > typedef struct { > EFI_MEMORY_TYPE MemoryType; > CHAR8 *MemoryTypeStr; > -- > 2.7.0.windows.1