TianoCore EDK2 master
Loading...
Searching...
No Matches
FspCommonLib.c File Reference
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <FspGlobalData.h>
#include <FspEas.h>
#include <Library/FspSwitchStackLib.h>

Go to the source code of this file.

Data Structures

struct  CONTEXT_STACK
 
struct  CONTEXT_STACK_64
 

Macros

#define CONTEXT_STACK_OFFSET(x)   (sizeof(UINTN) == sizeof (UINT32) ? (UINTN)&((CONTEXT_STACK *)(UINTN)0)->x : (UINTN)&((CONTEXT_STACK_64 *)(UINTN)0)->x)
 

Functions

VOID EFIAPI SetFspGlobalDataPointer (IN FSP_GLOBAL_DATA *FspData)
 
FSP_GLOBAL_DATA *EFIAPI GetFspGlobalDataPointer (VOID)
 
UINTN EFIAPI GetFspApiParameter (VOID)
 
VOID *EFIAPI GetFspEntryStack (VOID)
 
UINTN EFIAPI GetFspApiParameter2 (VOID)
 
VOID EFIAPI SetFspApiParameter (IN UINT32 Value)
 
VOID EFIAPI SetFspApiReturnStatus (IN UINTN ReturnStatus)
 
VOID EFIAPI SetFspCoreStackPointer (IN VOID *NewStackTop)
 
VOID EFIAPI SetFspPlatformDataPointer (IN VOID *PlatformData)
 
VOID *EFIAPI GetFspPlatformDataPointer (VOID)
 
VOID EFIAPI SetFspUpdDataPointer (IN VOID *UpdDataPtr)
 
VOID *EFIAPI GetFspUpdDataPointer (VOID)
 
VOID EFIAPI SetFspMemoryInitUpdDataPointer (IN VOID *MemoryInitUpdPtr)
 
VOID *EFIAPI GetFspMemoryInitUpdDataPointer (VOID)
 
VOID EFIAPI SetFspSiliconInitUpdDataPointer (IN VOID *SiliconInitUpdPtr)
 
VOID *EFIAPI GetFspSiliconInitUpdDataPointer (VOID)
 
VOID EFIAPI SetFspSmmInitUpdDataPointer (IN VOID *SmmInitUpdPtr)
 
VOID *EFIAPI GetFspSmmInitUpdDataPointer (VOID)
 
UINT64 EFIAPI SetFspMeasurePoint (IN UINT8 Id)
 
FSP_INFO_HEADER *EFIAPI GetFspInfoHeader (VOID)
 
VOID EFIAPI SetFspInfoHeader (FSP_INFO_HEADER *FspInfoHeader)
 
FSP_INFO_HEADER *EFIAPI GetFspInfoHeaderFromApiContext (VOID)
 
VOID *EFIAPI GetFspCfgRegionDataPointer (VOID)
 
UINT8 EFIAPI GetFspApiCallingIndex (VOID)
 
VOID EFIAPI SetFspApiCallingIndex (UINT8 Index)
 
UINT32 EFIAPI GetPhaseStatusCode (VOID)
 
VOID EFIAPI SetPhaseStatusCode (UINT32 StatusCode)
 

Detailed Description

Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file FspCommonLib.c.

Macro Definition Documentation

◆ CONTEXT_STACK_OFFSET

#define CONTEXT_STACK_OFFSET (   x)    (sizeof(UINTN) == sizeof (UINT32) ? (UINTN)&((CONTEXT_STACK *)(UINTN)0)->x : (UINTN)&((CONTEXT_STACK_64 *)(UINTN)0)->x)

Definition at line 47 of file FspCommonLib.c.

Function Documentation

◆ GetFspApiCallingIndex()

UINT8 EFIAPI GetFspApiCallingIndex ( VOID  )

This function gets FSP API calling index.

Return values
APIcalling index

Definition at line 500 of file FspCommonLib.c.

◆ GetFspApiParameter()

UINTN EFIAPI GetFspApiParameter ( VOID  )

This function gets back the FSP API first parameter passed by the bootloader.

Return values
ApiParameterFSP API first parameter passed by the bootloader.

Definition at line 90 of file FspCommonLib.c.

◆ GetFspApiParameter2()

UINTN EFIAPI GetFspApiParameter2 ( VOID  )

This function gets back the FSP API second parameter passed by the bootloader.

Return values
ApiParameterFSP API second parameter passed by the bootloader.

Definition at line 124 of file FspCommonLib.c.

◆ GetFspCfgRegionDataPointer()

VOID *EFIAPI GetFspCfgRegionDataPointer ( VOID  )

This function gets the CfgRegion data pointer.

Returns
CfgRegion data pointer.

Definition at line 483 of file FspCommonLib.c.

◆ GetFspEntryStack()

VOID *EFIAPI GetFspEntryStack ( VOID  )

This function returns the FSP entry stack pointer from address of the first API parameter.

Return values
FSPentry stack pointer.

Definition at line 107 of file FspCommonLib.c.

◆ GetFspGlobalDataPointer()

FSP_GLOBAL_DATA *EFIAPI GetFspGlobalDataPointer ( VOID  )

This function gets the FSP global data pointer.

Definition at line 73 of file FspCommonLib.c.

◆ GetFspInfoHeader()

FSP_INFO_HEADER *EFIAPI GetFspInfoHeader ( VOID  )

This function gets the FSP info header pointer.

Return values
FspInfoHeaderFSP info header pointer

Definition at line 438 of file FspCommonLib.c.

◆ GetFspInfoHeaderFromApiContext()

FSP_INFO_HEADER *EFIAPI GetFspInfoHeaderFromApiContext ( VOID  )

This function gets the FSP info header pointer using the API stack context.

Return values
FspInfoHeaderFSP info header pointer using the API stack context

Definition at line 466 of file FspCommonLib.c.

◆ GetFspMemoryInitUpdDataPointer()

VOID *EFIAPI GetFspMemoryInitUpdDataPointer ( VOID  )

This function gets the FspMemoryInit UPD data pointer.

Returns
FspMemoryInit UPD data pointer.

Definition at line 309 of file FspCommonLib.c.

◆ GetFspPlatformDataPointer()

VOID *EFIAPI GetFspPlatformDataPointer ( VOID  )

This function gets the platform specific data pointer.

Parameters
[in]PlatformDataFSP platform specific data pointer.

Definition at line 227 of file FspCommonLib.c.

◆ GetFspSiliconInitUpdDataPointer()

VOID *EFIAPI GetFspSiliconInitUpdDataPointer ( VOID  )

This function gets the FspSiliconInit UPD data pointer.

Returns
FspSiliconInit UPD data pointer.

Definition at line 350 of file FspCommonLib.c.

◆ GetFspSmmInitUpdDataPointer()

VOID *EFIAPI GetFspSmmInitUpdDataPointer ( VOID  )

This function gets the FspSmmInit UPD data pointer.

Returns
FspSmmInit UPD data pointer.

Definition at line 391 of file FspCommonLib.c.

◆ GetFspUpdDataPointer()

VOID *EFIAPI GetFspUpdDataPointer ( VOID  )

This function gets the UPD data pointer.

Returns
UpdDataPtr UPD data pointer.

Definition at line 268 of file FspCommonLib.c.

◆ GetPhaseStatusCode()

UINT32 EFIAPI GetPhaseStatusCode ( VOID  )

This function gets FSP Phase StatusCode.

Return values
StatusCode

Definition at line 531 of file FspCommonLib.c.

◆ SetFspApiCallingIndex()

VOID EFIAPI SetFspApiCallingIndex ( UINT8  Index)

This function sets FSP API calling mode.

Parameters
[in]IndexAPI calling index

Definition at line 514 of file FspCommonLib.c.

◆ SetFspApiParameter()

VOID EFIAPI SetFspApiParameter ( IN UINT32  Value)

This function sets the FSP API parameter in the stack.

Parameters
[in]ValueNew parameter value.

Definition at line 142 of file FspCommonLib.c.

◆ SetFspApiReturnStatus()

VOID EFIAPI SetFspApiReturnStatus ( IN UINTN  ReturnStatus)

This function set the API status code returned to the BootLoader.

Parameters
[in]ReturnStatusStatus code to return.

Definition at line 160 of file FspCommonLib.c.

◆ SetFspCoreStackPointer()

VOID EFIAPI SetFspCoreStackPointer ( IN VOID *  NewStackTop)

This function sets the context switching stack to a new stack frame.

Parameters
[in]NewStackTopNew core stack to be set.

Definition at line 178 of file FspCommonLib.c.

◆ SetFspGlobalDataPointer()

VOID EFIAPI SetFspGlobalDataPointer ( IN FSP_GLOBAL_DATA FspData)

This function sets the FSP global data pointer.

Parameters
[in]FspDataFSP global data pointer.

Definition at line 59 of file FspCommonLib.c.

◆ SetFspInfoHeader()

VOID EFIAPI SetFspInfoHeader ( FSP_INFO_HEADER FspInfoHeader)

This function sets the FSP info header pointer.

Parameters
[in]FspInfoHeaderFSP info header pointer

Definition at line 452 of file FspCommonLib.c.

◆ SetFspMeasurePoint()

UINT64 EFIAPI SetFspMeasurePoint ( IN UINT8  Id)

Set FSP measurement point timestamp.

Parameters
[in]IdMeasurement point ID.
Returns
performance timestamp if current PerfIdx is valid, else return 0 as invalid performance timestamp

Definition at line 411 of file FspCommonLib.c.

◆ SetFspMemoryInitUpdDataPointer()

VOID EFIAPI SetFspMemoryInitUpdDataPointer ( IN VOID *  MemoryInitUpdPtr)

This function sets the FspMemoryInit UPD data pointer.

Parameters
[in]MemoryInitUpdPtrFspMemoryInit UPD data pointer.

Definition at line 285 of file FspCommonLib.c.

◆ SetFspPlatformDataPointer()

VOID EFIAPI SetFspPlatformDataPointer ( IN VOID *  PlatformData)

This function sets the platform specific data pointer.

Parameters
[in]PlatformDataFSP platform specific data pointer.

Definition at line 209 of file FspCommonLib.c.

◆ SetFspSiliconInitUpdDataPointer()

VOID EFIAPI SetFspSiliconInitUpdDataPointer ( IN VOID *  SiliconInitUpdPtr)

This function sets the FspSiliconInit UPD data pointer.

Parameters
[in]SiliconInitUpdPtrFspSiliconInit UPD data pointer.

Definition at line 326 of file FspCommonLib.c.

◆ SetFspSmmInitUpdDataPointer()

VOID EFIAPI SetFspSmmInitUpdDataPointer ( IN VOID *  SmmInitUpdPtr)

This function sets the FspSmmInit UPD data pointer.

Parameters
[in]SmmInitUpdPtrFspSmmInit UPD data pointer.

Definition at line 367 of file FspCommonLib.c.

◆ SetFspUpdDataPointer()

VOID EFIAPI SetFspUpdDataPointer ( IN VOID *  UpdDataPtr)

This function sets the UPD data pointer.

Parameters
[in]UpdDataPtrUPD data pointer.

Definition at line 244 of file FspCommonLib.c.

◆ SetPhaseStatusCode()

VOID EFIAPI SetPhaseStatusCode ( UINT32  StatusCode)

This function sets FSP Phase StatusCode.

Parameters
[in]ModePhase StatusCode

Definition at line 545 of file FspCommonLib.c.