* [Patch] MdeModulePkg PiSmmCore: Update comments in InitializeMemoryServices
@ 2016-12-01 6:47 Liming Gao
2016-12-01 7:41 ` Yao, Jiewen
0 siblings, 1 reply; 3+ messages in thread
From: Liming Gao @ 2016-12-01 6:47 UTC (permalink / raw)
To: edk2-devel; +Cc: Star Zeng, Jiewen Yao
Add the comments to describe Free and Allocated SMRAM are added separately.
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch] MdeModulePkg PiSmmCore: Update comments in InitializeMemoryServices
2016-12-01 6:47 [Patch] MdeModulePkg PiSmmCore: Update comments in InitializeMemoryServices Liming Gao
@ 2016-12-01 7:41 ` Yao, Jiewen
2016-12-01 8:38 ` Gao, Liming
0 siblings, 1 reply; 3+ messages in thread
From: Yao, Jiewen @ 2016-12-01 7:41 UTC (permalink / raw)
To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Zeng, Star
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 <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [Patch] MdeModulePkg PiSmmCore: Update comments in
> InitializeMemoryServices
>
> Add the comments to describe Free and Allocated SMRAM are added
> separately.
>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] MdeModulePkg PiSmmCore: Update comments in InitializeMemoryServices
2016-12-01 7:41 ` Yao, Jiewen
@ 2016-12-01 8:38 ` Gao, Liming
0 siblings, 0 replies; 3+ messages in thread
From: Gao, Liming @ 2016-12-01 8:38 UTC (permalink / raw)
To: Yao, Jiewen, edk2-devel@lists.01.org; +Cc: Zeng, Star
Got it. I will keep comment "Need add Free memory at first, to let gSmmMemoryMap record data".
-----Original Message-----
From: Yao, Jiewen
Sent: Thursday, December 01, 2016 3:41 PM
To: Gao, Liming <liming.gao@intel.com>; edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: RE: [Patch] MdeModulePkg PiSmmCore: Update comments in InitializeMemoryServices
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 <star.zeng@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>
> Subject: [Patch] MdeModulePkg PiSmmCore: Update comments in
> InitializeMemoryServices
>
> Add the comments to describe Free and Allocated SMRAM are added
> separately.
>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-01 8:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-01 6:47 [Patch] MdeModulePkg PiSmmCore: Update comments in InitializeMemoryServices Liming Gao
2016-12-01 7:41 ` Yao, Jiewen
2016-12-01 8:38 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox