TianoCore EDK2 master
Loading...
Searching...
No Matches
EsrtFmp.c File Reference

Go to the source code of this file.

Data Structures

struct  GUID_HARDWAREINSTANCE_PAIR
 

Functions

VOID EFIAPI PrintTable (IN EFI_SYSTEM_RESOURCE_TABLE *Table)
 
EFI_STATUS InstallEfiSystemResourceTableInUefiConfigurationTable (IN EFI_SYSTEM_RESOURCE_TABLE *Table)
 
BOOLEAN IsSystemFmp (IN EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfo)
 
EFI_STATUS CreateEsrtEntry (IN OUT EFI_SYSTEM_RESOURCE_TABLE *Table, IN OUT GUID_HARDWAREINSTANCE_PAIR *HardwareInstances, IN OUT UINT32 *NumberOfDescriptors, IN EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfoBuf, IN UINT32 FmpVersion)
 
EFI_FIRMWARE_IMAGE_DESCRIPTORFmpGetFirmwareImageDescriptor (IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *Fmp, OUT UINT32 *FmpImageInfoDescriptorVer, OUT UINT8 *FmpImageInfoCount, OUT UINTN *DescriptorSize)
 
EFI_SYSTEM_RESOURCE_TABLECreateFmpBasedEsrt (VOID)
 
VOID EFIAPI EsrtReadyToBootEventNotify (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI EsrtFmpEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Detailed Description

Publishes ESRT table from Firmware Management Protocol instances

Copyright (c) 2016, Microsoft Corporation Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.

All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EsrtFmp.c.

Function Documentation

◆ CreateEsrtEntry()

EFI_STATUS CreateEsrtEntry ( IN OUT EFI_SYSTEM_RESOURCE_TABLE Table,
IN OUT GUID_HARDWAREINSTANCE_PAIR HardwareInstances,
IN OUT UINT32 *  NumberOfDescriptors,
IN EFI_FIRMWARE_IMAGE_DESCRIPTOR FmpImageInfoBuf,
IN UINT32  FmpVersion 
)

Function to create a single ESRT Entry and add it to the ESRT with a given FMP descriptor. If the GUID is already in the ESRT, then the ESRT entry is updated.

Parameters
[in,out]TablePointer to the ESRT Table.
[in,out]HardwareInstancesPointer to the GUID_HARDWAREINSTANCE_PAIR.
[in,out]NumberOfDescriptorsThe number of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
[in]FmpImageInfoBufPointer to the EFI_FIRMWARE_IMAGE_DESCRIPTOR.
[in]FmpVersionFMP Version.
Return values
EFI_SUCCESSFmpImageInfoBuf was use to fill in a new ESRT entry in Table.
EFI_SUCCESSThe ImageTypeId GUID in FmpImageInfoBuf matches an existing ESRT entry in Table, and the information from FmpImageInfoBuf was merged into the the existing ESRT entry.
EFI_UNSPOORTEDThe GUID/HardareInstance in FmpImageInfoBuf has is a duplicate.

Definition at line 137 of file EsrtFmp.c.

◆ CreateFmpBasedEsrt()

EFI_SYSTEM_RESOURCE_TABLE * CreateFmpBasedEsrt ( VOID  )

Function to create ESRT based on FMP Instances. Create ESRT table, get the descriptors from FMP Instance and create ESRT entries (ESRE).

Returns
Pointer to the ESRT created.

Definition at line 369 of file EsrtFmp.c.

◆ EsrtFmpEntryPoint()

EFI_STATUS EFIAPI EsrtFmpEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The module Entry Point of the Efi System Resource Table DXE driver.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
OtherSome error occurs when executing this entry point.

Definition at line 542 of file EsrtFmp.c.

◆ EsrtReadyToBootEventNotify()

VOID EFIAPI EsrtReadyToBootEventNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notify function for event group EFI_EVENT_GROUP_READY_TO_BOOT. This is used to install the Efi System Resource Table.

Parameters
[in]EventThe Event that is being processed.
[in]ContextThe Event Context.

Definition at line 499 of file EsrtFmp.c.

◆ FmpGetFirmwareImageDescriptor()

EFI_FIRMWARE_IMAGE_DESCRIPTOR * FmpGetFirmwareImageDescriptor ( IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL Fmp,
OUT UINT32 *  FmpImageInfoDescriptorVer,
OUT UINT8 *  FmpImageInfoCount,
OUT UINTN DescriptorSize 
)

Function to retrieve the EFI_FIRMWARE_IMAGE_DESCRIPTOR from an FMP Instance. The returned buffer is allocated using AllocatePool() and must be freed by the caller using FreePool().

Parameters
[in]FmpPointer to an EFI_FIRMWARE_MANAGEMENT_PROTOCOL.
[out]FmpImageInfoDescriptorVerPointer to the version number associated with the returned EFI_FIRMWARE_IMAGE_DESCRIPTOR.
[out]FmpImageInfoCountPointer to the number of the returned EFI_FIRMWARE_IMAGE_DESCRIPTORs.
[out]DescriptorSizePointer to the size, in bytes, of each returned EFI_FIRMWARE_IMAGE_DESCRIPTOR.
Returns
Pointer to the retrieved EFI_FIRMWARE_IMAGE_DESCRIPTOR. If the descriptor can not be retrieved, then NULL is returned.

Definition at line 301 of file EsrtFmp.c.

◆ InstallEfiSystemResourceTableInUefiConfigurationTable()

EFI_STATUS InstallEfiSystemResourceTableInUefiConfigurationTable ( IN EFI_SYSTEM_RESOURCE_TABLE Table)

Install EFI System Resource Table into the UEFI Configuration Table

Parameters
[in]TablePointer to the ESRT.
Returns
Status code.

Definition at line 61 of file EsrtFmp.c.

◆ IsSystemFmp()

BOOLEAN IsSystemFmp ( IN EFI_FIRMWARE_IMAGE_DESCRIPTOR FmpImageInfo)

Return if this FMP is a system FMP or a device FMP, based upon FmpImageInfo.

Parameters
[in]FmpImageInfoA pointer to EFI_FIRMWARE_IMAGE_DESCRIPTOR
Returns
TRUE It is a system FMP.
FALSE It is a device FMP.

Definition at line 95 of file EsrtFmp.c.

◆ PrintTable()

VOID EFIAPI PrintTable ( IN EFI_SYSTEM_RESOURCE_TABLE Table)

Print ESRT to debug console.

Parameters
[in]TablePointer to the ESRT table.

Function to print the ESRT table to the debug console.

Parameters
[in]Table- Pointer to the ESRT table

Definition at line 94 of file EsrtFmpDebugPrint.c.