]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/Library/BaseFspCommonLib/FspCommonLib.c
Update IntelFspPkg to support FSP1.1
[mirror_edk2.git] / IntelFspPkg / Library / BaseFspCommonLib / FspCommonLib.c
index 958a7322a0379acbfb548362118f86b2bbe3f0dc..f80dff1a56b5cf3aaede8f134af927b2b55487f6 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
@@ -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
@@ -316,3 +316,66 @@ 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 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