]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspWrapperPkg/FspInitPei/SecMain.c
EmbeddedPkg/MmcDxe: eliminate deprecated string function calls
[mirror_edk2.git] / IntelFspWrapperPkg / FspInitPei / SecMain.c
index 10550e74de1a33af5aea5d9f20d2a544ea0da485..e4f397a0d467f3dbbc526e3400031ea688976097 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   C functions in SEC\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
@@ -28,6 +28,10 @@ EFI_PEI_PPI_DESCRIPTOR            mPeiSecMainPpi[] = {
   },\r
 };\r
 \r
+FSP_INIT_DONE_PPI gFspInitDonePpi = {\r
+  FspInitDoneGetFspHobList\r
+};\r
+\r
 //\r
 // These are IDT entries pointing to 10:FFFFFFE4h.\r
 //\r
@@ -57,7 +61,7 @@ SecStartupPhase2(
   the control is transferred to this function.\r
 \r
   @param[in] SizeOfRam           Size of the temporary memory available for use.\r
-  @param[in] TempRamBase         Base address of tempory ram\r
+  @param[in] TempRamBase         Base address of temporary ram\r
   @param[in] BootFirmwareVolume  Base address of the Boot Firmware Volume.\r
 **/\r
 VOID\r
@@ -267,3 +271,40 @@ SecStartupPhase2(
   //\r
   return ;\r
 }\r
+\r
+/**\r
+  Return Hob list produced by FSP.\r
+\r
+  @param[in]  PeiServices  The pointer to the PEI Services Table.\r
+  @param[in]  This         The pointer to this instance of this PPI.\r
+  @param[out] FspHobList   The pointer to Hob list produced by FSP.\r
+\r
+  @return EFI_SUCCESS FReturn Hob list produced by FSP successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FspInitDoneGetFspHobList (\r
+  IN  CONST EFI_PEI_SERVICES         **PeiServices,\r
+  IN  FSP_INIT_DONE_PPI              *This,\r
+  OUT VOID                           **FspHobList\r
+  )\r
+{\r
+  VOID        *TopOfTemporaryRamPpi;\r
+  EFI_STATUS  Status;\r
+\r
+  Status = (*PeiServices)->LocatePpi (\r
+                             PeiServices,\r
+                             &gTopOfTemporaryRamPpiGuid,\r
+                             0,\r
+                             NULL,\r
+                             (VOID **) &TopOfTemporaryRamPpi\r
+                             );\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+\r
+  *FspHobList = (VOID *)(UINTN)(*(UINT32 *)((UINTN)TopOfTemporaryRamPpi - sizeof(UINT32)));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r