Revision: 18018
          http://sourceforge.net/p/edk2/code/18018
Author:   lgao4
Date:     2015-07-16 05:42:58 +0000 (Thu, 16 Jul 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c

Modified: trunk/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
===================================================================
--- trunk/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c   2015-07-16 02:37:53 UTC 
(rev 18017)
+++ trunk/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c   2015-07-16 05:42:58 UTC 
(rev 18018)
@@ -273,31 +273,36 @@
     //
   }
 
-  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
+          );
+      }
     }
   }
 


------------------------------------------------------------------------------
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-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to