summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/DxeIplPeim
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2015-07-16 05:42:58 +0000
committerlgao4 <lgao4@Edk2>2015-07-16 05:42:58 +0000
commitd1d89e86ed786f0170848a800e1569805248cb63 (patch)
tree90d54966d9f25dc381855676bf16d03d018a2d05 /MdeModulePkg/Core/DxeIplPeim
parent90ae1f0270caae87cf3faddacd8d43ba862a290f (diff)
downloadedk2-platforms-d1d89e86ed786f0170848a800e1569805248cb63.tar.xz
MdeModulePkg DxeIpl: Skip install MemoryInfoHob if this hob exists
Add the check at DxeLoadCore() on MdeModulePkg\Core\DxeIplPeim\DxeLoad.c to skip install the "gEfiMemoryTypeInformationGuid" hob if it is already installed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18018 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/DxeIplPeim')
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeLoad.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index aa0507686b..d7d693fdeb 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -273,31 +273,36 @@ DxeLoadCore (
//
}
- Status = PeiServicesLocatePpi (
- &gEfiPeiReadOnlyVariable2PpiGuid,
- 0,
- NULL,
- (VOID **)&Variable
- );
- if (!EFI_ERROR (Status)) {
- DataSize = sizeof (MemoryData);
- Status = Variable->GetVariable (
- Variable,
- EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
- &gEfiMemoryTypeInformationGuid,
- NULL,
- &DataSize,
- &MemoryData
- );
- if (!EFI_ERROR (Status) && ValidateMemoryTypeInfoVariable(MemoryData, DataSize)) {
- //
- // Build the GUID'd HOB for DXE
- //
- BuildGuidDataHob (
- &gEfiMemoryTypeInformationGuid,
- MemoryData,
- DataSize
- );
+ if (GetFirstGuidHob ((CONST EFI_GUID *)&gEfiMemoryTypeInformationGuid) == NULL) {
+ //
+ // Don't build GuidHob if GuidHob has been installed.
+ //
+ Status = PeiServicesLocatePpi (
+ &gEfiPeiReadOnlyVariable2PpiGuid,
+ 0,
+ NULL,
+ (VOID **)&Variable
+ );
+ if (!EFI_ERROR (Status)) {
+ DataSize = sizeof (MemoryData);
+ Status = Variable->GetVariable (
+ Variable,
+ EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
+ &gEfiMemoryTypeInformationGuid,
+ NULL,
+ &DataSize,
+ &MemoryData
+ );
+ if (!EFI_ERROR (Status) && ValidateMemoryTypeInfoVariable(MemoryData, DataSize)) {
+ //
+ // Build the GUID'd HOB for DXE
+ //
+ BuildGuidDataHob (
+ &gEfiMemoryTypeInformationGuid,
+ MemoryData,
+ DataSize
+ );
+ }
}
}