From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 3459D81C69 for ; Wed, 30 Nov 2016 23:41:23 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP; 30 Nov 2016 23:41:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,723,1477983600"; d="scan'208";a="37745558" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 30 Nov 2016 23:41:22 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 30 Nov 2016 23:41:22 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 30 Nov 2016 23:41:21 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.218]) with mapi id 14.03.0248.002; Thu, 1 Dec 2016 15:41:20 +0800 From: "Yao, Jiewen" To: "Gao, Liming" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [Patch] MdeModulePkg PiSmmCore: Update comments in InitializeMemoryServices Thread-Index: AQHSS57GPP0DZdze1Emo8Ms4+CaFsqDytPFw Date: Thu, 1 Dec 2016 07:41:19 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386DEB3E@shsmsx102.ccr.corp.intel.com> References: <1480574828-21908-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1480574828-21908-1-git-send-email-liming.gao@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: Update comments in InitializeMemoryServices 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: Thu, 01 Dec 2016 07:41:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable HI Liming How about we keep original comment? Your new comment describes *what* the coding is doing, and original comment= describes *why*. If you agree, reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Gao, Liming > Sent: Thursday, December 1, 2016 2:47 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [Patch] MdeModulePkg PiSmmCore: Update comments in > InitializeMemoryServices >=20 > Add the comments to describe Free and Allocated SMRAM are added > separately. >=20 > Cc: Star Zeng > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Liming Gao > --- > MdeModulePkg/Core/PiSmmCore/Pool.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c > b/MdeModulePkg/Core/PiSmmCore/Pool.c > index dcfd13e..b638aad 100644 > --- a/MdeModulePkg/Core/PiSmmCore/Pool.c > +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c > @@ -85,8 +85,7 @@ SmmInitializeMemoryServices ( > SmramRanges[CurrentSmramRangesIndex].PhysicalSize =3D > SmramRanges[CurrentSmramRangesIndex].PhysicalSize - SmmCodeSize; > } > // > - // Initialize free SMRAM regions > - // Need add Free memory at first, to let gSmmMemoryMap record data > + // Add Free SMRAM regions > // > for (Index =3D 0; Index < SmramRangeCount; Index++) { > if ((SmramRanges[Index].RegionState & (EFI_ALLOCATED | > EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) !=3D 0) { > @@ -100,6 +99,9 @@ SmmInitializeMemoryServices ( > ); > } >=20 > + // > + // Add the allocated SMRAM regions > + // > for (Index =3D 0; Index < SmramRangeCount; Index++) { > if ((SmramRanges[Index].RegionState & (EFI_ALLOCATED | > EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) =3D=3D 0) { > continue; > -- > 2.8.0.windows.1