mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
90ae1f0270
commit
d1d89e86ed
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue