From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 B7CE481F15 for ; Wed, 30 Nov 2016 22:47:14 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 30 Nov 2016 22:47:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,723,1477983600"; d="scan'208";a="907481121" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.23]) by orsmga003.jf.intel.com with ESMTP; 30 Nov 2016 22:47:12 -0800 From: Liming Gao To: edk2-devel@lists.01.org Cc: Star Zeng , Jiewen Yao Date: Thu, 1 Dec 2016 14:47:08 +0800 Message-Id: <1480574828-21908-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [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 06:47:14 -0000 Add the comments to describe Free and Allocated SMRAM are added separately. 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(-) 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 = 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 = 0; Index < SmramRangeCount; Index++) { if ((SmramRanges[Index].RegionState & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) != 0) { @@ -100,6 +99,9 @@ SmmInitializeMemoryServices ( ); } + // + // Add the allocated SMRAM regions + // for (Index = 0; Index < SmramRangeCount; Index++) { if ((SmramRanges[Index].RegionState & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) == 0) { continue; -- 2.8.0.windows.1