]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/FspHobProcessLibSample.c
Update IntelFspWrapperPkg according to FSP1.1.
[mirror_edk2.git] / IntelFspWrapperPkg / Library / PeiFspHobProcessLibSample / FspHobProcessLibSample.c
index f293dc8be8096c231ed8749ef073c36a5b1d32d0..bad61117784c0bf5c3d73946a451bae0681be8ab 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Sample to provide FSP hob process related function.\r
 \r
-  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -132,7 +132,7 @@ GetPeiMemSize (
 }\r
 \r
 /**\r
-  BIOS process FspBobList.\r
+  BIOS process FspBobList for Memory Resource Descriptor.\r
 \r
   @param[in] FspHobList  Pointer to the HOB data structure produced by FSP.\r
 \r
@@ -140,7 +140,7 @@ GetPeiMemSize (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-FspHobProcess (\r
+FspHobProcessForMemoryResource (\r
   IN VOID                 *FspHobList\r
   )\r
 {\r
@@ -244,12 +244,14 @@ FspHobProcess (
       LowMemorySize\r
       );\r
 \r
+    S3PeiMemBase = 0;\r
+    S3PeiMemSize = 0;\r
     Status = GetS3MemoryInfo (&S3PeiMemBase, &S3PeiMemSize);\r
     ASSERT_EFI_ERROR (Status);\r
     DEBUG((DEBUG_INFO, "S3 memory %Xh - %Xh bytes\n", S3PeiMemBase, S3PeiMemSize));\r
 \r
     //\r
-    // Make sure Stack and PeiMemory are not overlap - JYAO1\r
+    // Make sure Stack and PeiMemory are not overlap\r
     //\r
 \r
     Status = PeiServicesInstallPeiMemory (\r
@@ -278,7 +280,7 @@ FspHobProcess (
 \r
       if (Status == EFI_SUCCESS) {\r
         //\r
-        // Make sure Stack and CapsuleBuffer are not overlap - JYAO1\r
+        // Make sure Stack and CapsuleBuffer are not overlap\r
         //\r
         CapsuleBuffer = (VOID *)(UINTN)BASE_1MB;\r
         CapsuleBufferLength = (UINTN)(LowMemorySize - PeiMemSize);\r
@@ -311,7 +313,7 @@ FspHobProcess (
       );\r
 \r
     //\r
-    // Make sure Stack and CapsuleBuffer are not overlap - JYAO1\r
+    // Make sure Stack and CapsuleBuffer are not overlap\r
     //\r
 \r
     //\r
@@ -329,9 +331,45 @@ FspHobProcess (
     }\r
   }\r
 \r
-  //\r
-  // NV Storage Hob\r
-  //\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  BIOS process FspBobList for other data (not Memory Resource Descriptor).\r
+\r
+  @param[in] FspHobList  Pointer to the HOB data structure produced by FSP.\r
 \r
+  @return If platform process the FSP hob list successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FspHobProcessForOtherData (\r
+  IN VOID                 *FspHobList\r
+  )\r
+{\r
   return EFI_SUCCESS;\r
 }\r
+\r
+/**\r
+  BIOS process FspBobList.\r
+\r
+  @param[in] FspHobList  Pointer to the HOB data structure produced by FSP.\r
+\r
+  @return If platform process the FSP hob list successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FspHobProcess (\r
+  IN VOID                 *FspHobList\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  Status = FspHobProcessForMemoryResource (FspHobList);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  Status = FspHobProcessForOtherData (FspHobList);\r
+\r
+  return Status;\r
+}\r