Publish FspHob to PEI Hob by default.
authorYao, Jiewen <jiewen.yao@intel.com>
Tue, 27 Oct 2015 23:10:49 +0000 (23:10 +0000)
committerjyao1 <jyao1@Edk2>
Tue, 27 Oct 2015 23:10:49 +0000 (23:10 +0000)
because most platforms use such logic.
PcdDataBaseHobGuid GuidHob is excluded because PCD database in FSP is different with the one in PEI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18687 6f19259b-4bc3-4df7-8a09-765794883524

IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/FspHobProcessLibSample.c
IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/PeiFspHobProcessLibSample.inf

index 099980e..a96c151 100644 (file)
@@ -25,6 +25,7 @@
 \r
 #include <Guid/GuidHobFspEas.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
+#include <Guid/PcdDataBaseHobGuid.h>\r
 #include <Ppi/Capsule.h>\r
 \r
 //\r
@@ -334,6 +335,41 @@ FspHobProcessForMemoryResource (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Process FSP HOB list\r
+\r
+  @param[in] FspHobList  Pointer to the HOB data structure produced by FSP.\r
+\r
+**/\r
+VOID\r
+ProcessFspHobList (\r
+  IN VOID                 *FspHobList\r
+  )\r
+{\r
+  EFI_PEI_HOB_POINTERS  FspHob;\r
+\r
+  FspHob.Raw = FspHobList;\r
+\r
+  //\r
+  // Add all the HOBs from FSP binary to FSP wrapper\r
+  //\r
+  while (!END_OF_HOB_LIST (FspHob)) {\r
+    if (FspHob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) {\r
+      //\r
+      // Skip FSP binary creates PcdDataBaseHobGuid\r
+      //\r
+      if (!CompareGuid(&FspHob.Guid->Name, &gPcdDataBaseHobGuid)) { \r
+        BuildGuidDataHob (\r
+          &FspHob.Guid->Name,\r
+          GET_GUID_HOB_DATA(FspHob),\r
+          GET_GUID_HOB_DATA_SIZE(FspHob)\r
+        );\r
+      }\r
+    }\r
+    FspHob.Raw = GET_NEXT_HOB (FspHob);\r
+  }\r
+}\r
+\r
 /**\r
   BIOS process FspBobList for other data (not Memory Resource Descriptor).\r
 \r
@@ -347,6 +383,8 @@ FspHobProcessForOtherData (
   IN VOID                 *FspHobList\r
   )\r
 {\r
+  ProcessFspHobList (FspHobList);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
index 12f922c..c7f35f7 100644 (file)
@@ -70,6 +70,7 @@
 [Guids]\r
   gFspReservedMemoryResourceHobGuid                       ## CONSUMES ## HOB\r
   gEfiMemoryTypeInformationGuid                           ## CONSUMES ## GUID\r
+  gPcdDataBaseHobGuid                                     ## CONSUMES ## HOB\r
 \r
 [Ppis]\r
   gEfiPeiCapsulePpiGuid                                   ## CONSUMES\r