> -----Original Message----- > From: Liming Gao [mailto:liming....@intel.com] > Sent: Tuesday, July 14, 2015 6:06 PM > To: edk2-devel@lists.sourceforge.net > Subject: [edk2] [Patch] MdeModulePkg: Skip install MemoryInfoHob if this hob > exists
How about update the subject to "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....@intel.com> > --- > MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 55 > ++++++++++++++++++---------------- > 1 file changed, 30 insertions(+), 25 deletions(-) > > diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c > b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c > index aa05076..d7d693f 100644 > --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c > +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c > @@ -271,35 +271,40 @@ DxeLoadCore ( > // > // Now should have a HOB with the DXE core > // > } > > - 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. Since the code below is to install GuidHob, how about reverse the sentence to "Build GuidHob if it has not 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 > + ); > + } > } > } > > // > // Look in all the FVs present in PEI and find the DXE Core FileHandle > -- > 1.9.5.msysgit.0 > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel