TianoCore EDK2 master
Loading...
Searching...
No Matches
EsrtImpl.h File Reference

Go to the source code of this file.

Data Structures

struct  ESRT_PRIVATE_DATA
 

Macros

#define EFI_ESRT_NONFMP_VARIABLE_NAME   L"EsrtNonFmp"
 
#define EFI_ESRT_FMP_VARIABLE_NAME   L"EsrtFmp"
 
#define ESRT_FROM_FMP   0x00000001
 
#define ESRT_FROM_NONFMP   0x00000002
 

Functions

EFI_STATUS GetEsrtEntry (IN EFI_GUID *FwClass, IN UINTN Attribute, OUT EFI_SYSTEM_RESOURCE_ENTRY *Entry)
 
EFI_STATUS InsertEsrtEntry (IN EFI_SYSTEM_RESOURCE_ENTRY *Entry, UINTN Attribute)
 
EFI_STATUS DeleteEsrtEntry (IN EFI_GUID *FwClass, IN UINTN Attribute)
 
EFI_STATUS UpdateEsrtEntry (IN EFI_SYSTEM_RESOURCE_ENTRY *Entry, UINTN Attribute)
 
VOID SetEsrtEntryFromFmpInfo (IN OUT EFI_SYSTEM_RESOURCE_ENTRY *EsrtEntry, IN EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfo, IN UINT32 DescriptorVersion)
 
EFI_STATUS EFIAPI EsrtDxeGetEsrtEntry (IN EFI_GUID *FwClass, IN OUT EFI_SYSTEM_RESOURCE_ENTRY *Entry)
 
EFI_STATUS EFIAPI EsrtDxeUpdateEsrtEntry (IN EFI_SYSTEM_RESOURCE_ENTRY *Entry)
 
EFI_STATUS EFIAPI EsrtDxeUnRegisterEsrtEntry (IN EFI_GUID *FwClass)
 
EFI_STATUS EFIAPI EsrtDxeRegisterEsrtEntry (IN EFI_SYSTEM_RESOURCE_ENTRY *Entry)
 
EFI_STATUS EFIAPI EsrtDxeSyncFmp (VOID)
 
EFI_STATUS EFIAPI EsrtDxeLockEsrtRepository (VOID)
 

Detailed Description

Esrt management implementation head file.

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

Definition in file EsrtImpl.h.

Macro Definition Documentation

◆ EFI_ESRT_FMP_VARIABLE_NAME

#define EFI_ESRT_FMP_VARIABLE_NAME   L"EsrtFmp"

Definition at line 38 of file EsrtImpl.h.

◆ EFI_ESRT_NONFMP_VARIABLE_NAME

#define EFI_ESRT_NONFMP_VARIABLE_NAME   L"EsrtNonFmp"

Definition at line 33 of file EsrtImpl.h.

◆ ESRT_FROM_FMP

#define ESRT_FROM_FMP   0x00000001

Definition at line 43 of file EsrtImpl.h.

◆ ESRT_FROM_NONFMP

#define ESRT_FROM_NONFMP   0x00000002

Definition at line 44 of file EsrtImpl.h.

Function Documentation

◆ DeleteEsrtEntry()

EFI_STATUS DeleteEsrtEntry ( IN EFI_GUID FwClass,
IN UINTN  Attribute 
)

Delete ESRT Entry from ESRT repository.

Parameters
[in]FwClassFwClass of Esrt entry to delete
[in]AttributeEsrt from Esrt private protocol or FMP instance
Return values
EFI_SUCCESSInsert all entries Successfully
EFI_NOT_FOUNDESRT entry with FwClass doesn't exsit

Definition at line 209 of file EsrtImpl.c.

◆ EsrtDxeGetEsrtEntry()

EFI_STATUS EFIAPI EsrtDxeGetEsrtEntry ( IN EFI_GUID FwClass,
IN OUT EFI_SYSTEM_RESOURCE_ENTRY Entry 
)

Get ESRT entry from ESRT Cache by FwClass Guid

Parameters
[in]FwClassFwClass of Esrt entry to get
[in,out]EntryEsrt entry returned
Return values
EFI_SUCCESSThe variable saving this Esrt Entry exists.
EF_NOT_FOUNDNo correct variable found.
EFI_WRITE_PROTECTEDESRT Cache repository is locked

Definition at line 38 of file EsrtDxe.c.

◆ EsrtDxeLockEsrtRepository()

EFI_STATUS EFIAPI EsrtDxeLockEsrtRepository ( VOID  )

This function locks up Esrt repository to be readonly. It should be called before gEfiEndOfDxeEventGroupGuid event signaled

Return values
EFI_SUCCESSLocks up FMP Non-FMP repository successfully

Definition at line 478 of file EsrtDxe.c.

◆ EsrtDxeRegisterEsrtEntry()

EFI_STATUS EFIAPI EsrtDxeRegisterEsrtEntry ( IN EFI_SYSTEM_RESOURCE_ENTRY Entry)

Non-FMP instance to register one ESRT entry into ESRT Cache.

Parameters
[in]EntryEsrt entry to be set
Return values
EFI_SUCCESSSuccessfully set a variable.
EFI_INVALID_PARAMETERESRT Entry is already exist

Non-FMP instance to register one ESRT entry into ESRT Cache.

Parameters
[in]EntryEsrt entry to be set
Return values
EFI_SUCCESSSuccessfully set a variable.
EFI_INVALID_PARAMETERESRT Entry is already exist
EFI_OUT_OF_RESOURCESNon-FMP ESRT repository is full

Definition at line 179 of file EsrtDxe.c.

◆ EsrtDxeSyncFmp()

EFI_STATUS EFIAPI EsrtDxeSyncFmp ( VOID  )

This function syn up Cached ESRT with data from FMP instances Function should be called after Connect All in order to locate all FMP protocols installed.

Return values
EFI_SUCCESSSuccessfully sync cache repository from FMP instances
EFI_NOT_FOUNDNo FMP Instance are found
EFI_OUT_OF_RESOURCESResource allocaton fail

Definition at line 222 of file EsrtDxe.c.

◆ EsrtDxeUnRegisterEsrtEntry()

EFI_STATUS EFIAPI EsrtDxeUnRegisterEsrtEntry ( IN EFI_GUID FwClass)

Non-FMP instance to unregister Esrt Entry from ESRT Cache.

Parameters
[in]FwClassFwClass of Esrt entry to Unregister
Return values
EFI_SUCCESSInsert all entries Successfully
EFI_NOT_FOUNDEntry of FwClass does not exsit

Definition at line 145 of file EsrtDxe.c.

◆ EsrtDxeUpdateEsrtEntry()

EFI_STATUS EFIAPI EsrtDxeUpdateEsrtEntry ( IN EFI_SYSTEM_RESOURCE_ENTRY Entry)

Update one ESRT entry in ESRT Cache.

Parameters
[in]EntryEsrt entry to be updated
Return values
EFI_SUCCESSSuccessfully update an ESRT entry in cache.
EFI_INVALID_PARAMETEREntry does't exist in ESRT Cache
EFI_WRITE_PROTECTEDESRT Cache is locked

Update one ESRT entry in ESRT Cache.

Parameters
[in]EntryEsrt entry to be updated
Return values
EFI_SUCCESSSuccessfully update an ESRT entry in cache.
EFI_INVALID_PARAMETEREntry does't exist in ESRT Cache
EFI_WRITE_PROTECTEDESRT Cache repositoy is locked

Definition at line 98 of file EsrtDxe.c.

◆ GetEsrtEntry()

EFI_STATUS GetEsrtEntry ( IN EFI_GUID FwClass,
IN UINTN  Attribute,
OUT EFI_SYSTEM_RESOURCE_ENTRY Entry 
)

Find Esrt Entry stored in ESRT repository.

Parameters
[in]FwClassFirmware class guid in Esrt entry
[in]AttributeEsrt from Non FMP or FMP instance
[out]EntryEsrt entry returned
Return values
EFI_SUCCESSSuccessfully find an Esrt entry
EF_NOT_FOUNDNo Esrt entry found

Definition at line 23 of file EsrtImpl.c.

◆ InsertEsrtEntry()

EFI_STATUS InsertEsrtEntry ( IN EFI_SYSTEM_RESOURCE_ENTRY Entry,
UINTN  Attribute 
)

Insert a new ESRT entry into ESRT Cache repository.

Parameters
[in]EntryEsrt entry to be set
[in]AttributeEsrt from Esrt private protocol or FMP instance
Return values
EFI_SUCCESSSuccessfully set a variable.

Definition at line 92 of file EsrtImpl.c.

◆ SetEsrtEntryFromFmpInfo()

VOID SetEsrtEntryFromFmpInfo ( IN OUT EFI_SYSTEM_RESOURCE_ENTRY EsrtEntry,
IN EFI_FIRMWARE_IMAGE_DESCRIPTOR FmpImageInfo,
IN UINT32  DescriptorVersion 
)

Init one ESRT entry according to input FmpImageInfo (V1, V2, V3) .

Parameters
[in,out]EsrtEntryEsrt entry to be Init
[in]FmpImageInfoFMP image info descriptor
[in]DescriptorVersionFMP Image info descriptor version

Definition at line 434 of file EsrtImpl.c.

◆ UpdateEsrtEntry()

EFI_STATUS UpdateEsrtEntry ( IN EFI_SYSTEM_RESOURCE_ENTRY Entry,
UINTN  Attribute 
)

Update one ESRT entry in ESRT repository

Parameters
[in]EntryEsrt entry to be set
[in]AttributeEsrt from Non Esrt or FMP instance
Return values
EFI_SUCCESSSuccessfully Update a variable.
EFI_NOT_FOUNDThe Esrt enry doesn't exist

Definition at line 310 of file EsrtImpl.c.