]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/Library/BaseFspCommonLib/FspCommonLib.c
IntelFspPkg: Fix typos in comments
[mirror_edk2.git] / IntelFspPkg / Library / BaseFspCommonLib / FspCommonLib.c
index 958a7322a0379acbfb548362118f86b2bbe3f0dc..f6a4252c3f5a776a3c21c9e7fcf24623d2909552 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\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
@@ -27,7 +27,7 @@
 //   API Parameter                +0x34\r
 //   API return address           +0x30\r
 //\r
-//   push    offset exit          +0x2C\r
+//   push    FspInfoHeader        +0x2C\r
 //   pushfd                       +0x28\r
 //   cli\r
 //   pushad                       +0x24\r
@@ -47,7 +47,7 @@ typedef struct {
   UINT32    Ecx;\r
   UINT32    Eax;\r
   UINT16    Flags[2];\r
-  UINT32    ExitOff;\r
+  UINT32    FspInfoHeader;\r
   UINT32    ApiRet;\r
   UINT32    ApiParam;\r
 } CONTEXT_STACK;\r
@@ -89,9 +89,9 @@ GetFspGlobalDataPointer (
 }\r
 \r
 /**\r
-  This function gets back the FSP API paramter passed by the bootlaoder.\r
+  This function gets back the FSP API parameter passed by the bootlaoder.\r
 \r
-  @retval ApiParameter FSP API paramter passed by the bootlaoder.\r
+  @retval ApiParameter FSP API parameter passed by the bootlaoder.\r
 **/\r
 UINT32\r
 EFIAPI\r
@@ -106,7 +106,7 @@ GetFspApiParameter (
 }\r
 \r
 /**\r
-  This function sets the FSP API paramter in the stack.\r
+  This function sets the FSP API parameter in the stack.\r
 \r
    @param[in] Value       New parameter value.\r
 \r
@@ -144,7 +144,7 @@ SetFspContinuationFuncParameter (
 \r
 \r
 /**\r
-  This function changes the Bootloader return address in stack.\r
+  This function changes the BootLoader return address in stack.\r
 \r
   @param[in] ReturnAddress       Address to return.\r
 \r
@@ -162,7 +162,7 @@ SetFspApiReturnAddress (
 }\r
 \r
 /**\r
-  This function set the API status code returned to the bootloader.\r
+  This function set the API status code returned to the BootLoader.\r
 \r
   @param[in] ReturnStatus       Status code to return.\r
 \r
@@ -289,6 +289,91 @@ GetFspUpdDataPointer (
   return FspData->UpdDataRgnPtr;\r
 }\r
 \r
+\r
+/**\r
+  This function sets the memory init UPD data pointer.\r
+\r
+  @param[in] MemoryInitUpdPtr   memory init UPD data pointer.\r
+**/\r
+VOID\r
+EFIAPI\r
+SetFspMemoryInitUpdDataPointer (\r
+  IN VOID    *MemoryInitUpdPtr\r
+  )\r
+{\r
+  FSP_GLOBAL_DATA  *FspData;\r
+\r
+  //\r
+  // Get the Fsp Global Data Pointer\r
+  //\r
+  FspData  = GetFspGlobalDataPointer ();\r
+\r
+  //\r
+  // Set the memory init UPD pointer.\r
+  //\r
+  FspData->MemoryInitUpdPtr = MemoryInitUpdPtr;\r
+}\r
+\r
+/**\r
+  This function gets the memory init UPD data pointer.\r
+\r
+  @return memory init UPD data pointer.\r
+**/\r
+VOID *\r
+EFIAPI\r
+GetFspMemoryInitUpdDataPointer (\r
+  VOID\r
+  )\r
+{\r
+  FSP_GLOBAL_DATA  *FspData;\r
+\r
+  FspData  = GetFspGlobalDataPointer ();\r
+  return FspData->MemoryInitUpdPtr;\r
+}\r
+\r
+\r
+/**\r
+  This function sets the silicon init UPD data pointer.\r
+\r
+  @param[in] SiliconInitUpdPtr   silicon init UPD data pointer.\r
+**/\r
+VOID\r
+EFIAPI\r
+SetFspSiliconInitUpdDataPointer (\r
+  IN VOID    *SiliconInitUpdPtr\r
+  )\r
+{\r
+  FSP_GLOBAL_DATA  *FspData;\r
+\r
+  //\r
+  // Get the Fsp Global Data Pointer\r
+  //\r
+  FspData  = GetFspGlobalDataPointer ();\r
+\r
+  //\r
+  // Set the silicon init UPD data pointer.\r
+  //\r
+  FspData->SiliconInitUpdPtr = SiliconInitUpdPtr;\r
+}\r
+\r
+/**\r
+  This function gets the silicon init UPD data pointer.\r
+\r
+  @return silicon init UPD data pointer.\r
+**/\r
+VOID *\r
+EFIAPI\r
+GetFspSiliconInitUpdDataPointer (\r
+  VOID\r
+  )\r
+{\r
+  FSP_GLOBAL_DATA  *FspData;\r
+\r
+  FspData  = GetFspGlobalDataPointer ();\r
+  return FspData->SiliconInitUpdPtr;\r
+}\r
+\r
+\r
 /**\r
   Set FSP measurement point timestamp.\r
 \r
@@ -316,3 +401,83 @@ SetFspMeasurePoint (
 \r
   return FspData->PerfData[(FspData->PerfIdx)++];\r
 }\r
+\r
+/**\r
+  This function gets the FSP info header pointer.\r
+\r
+  @retval FspInfoHeader   FSP info header pointer\r
+**/\r
+FSP_INFO_HEADER *\r
+EFIAPI\r
+GetFspInfoHeader (\r
+  VOID\r
+  )\r
+{\r
+  return  GetFspGlobalDataPointer()->FspInfoHeader;\r
+}\r
+\r
+/**\r
+  This function gets the FSP info header pointer using the API stack context.\r
+\r
+  @retval FspInfoHeader   FSP info header pointer using the API stack context\r
+**/\r
+FSP_INFO_HEADER *\r
+EFIAPI\r
+GetFspInfoHeaderFromApiContext (\r
+  VOID\r
+  )\r
+{\r
+  FSP_GLOBAL_DATA  *FspData;\r
+\r
+  FspData  = GetFspGlobalDataPointer ();\r
+  return  (FSP_INFO_HEADER *)(*(UINT32 *)(UINTN)(FspData->CoreStack + CONTEXT_STACK_OFFSET(FspInfoHeader)));\r
+}\r
+\r
+/**\r
+  This function gets the VPD data pointer.\r
+\r
+  @return VpdDataRgnPtr   VPD data pointer.\r
+**/\r
+VOID *\r
+EFIAPI\r
+GetFspVpdDataPointer (\r
+  VOID\r
+  )\r
+{\r
+  FSP_INFO_HEADER   *FspInfoHeader;\r
+\r
+  FspInfoHeader = GetFspInfoHeader ();\r
+  return (VOID *)(FspInfoHeader->ImageBase + FspInfoHeader->CfgRegionOffset);\r
+}\r
+\r
+/**\r
+  This function gets FSP API calling mode.\r
+\r
+  @retval API calling mode\r
+**/\r
+UINT8\r
+EFIAPI\r
+GetFspApiCallingMode (\r
+  VOID\r
+  )\r
+{\r
+  return  GetFspGlobalDataPointer()->ApiMode;\r
+}\r
+\r
+/**\r
+  This function sets FSP API calling mode.\r
+\r
+  @param[in] Mode     API calling mode\r
+**/\r
+VOID\r
+EFIAPI\r
+SetFspApiCallingMode (\r
+  UINT8  Mode\r
+  )\r
+{\r
+  FSP_GLOBAL_DATA  *FspData;\r
+\r
+  FspData  = GetFspGlobalDataPointer ();\r
+  FspData->ApiMode = Mode;\r
+}\r
+\r