TianoCore EDK2 master
Loading...
Searching...
No Matches
VarCheckHiiGenFromFv.c File Reference
#include "VarCheckHiiGen.h"

Go to the source code of this file.

Data Structures

struct  VAR_CHECK_VFR_DRIVER_INFO
 

Macros

#define EFI_VFR_ATTRACT_GUID   { 0xd0bc7cb4, 0x6a47, 0x495f, { 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2 } }
 
#define ALL_FF_GUID   { 0xFFFFFFFF, 0xFFFF, 0xFFFF, { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } }
 
#define VAR_CHECK_VFR_DRIVER_INFO_SIGNATURE   SIGNATURE_32 ('V', 'D', 'R', 'I')
 
#define VAR_CHECK_VFR_DRIVER_INFO_FROM_LINK(a)   CR (a, VAR_CHECK_VFR_DRIVER_INFO, Link, VAR_CHECK_VFR_DRIVER_INFO_SIGNATURE)
 
#define MAX_MATCH_GUID_NUM   100
 

Functions

EFI_STATUS GetAddressByGuid (IN VOID *Ffs, IN EFI_GUID *Guid, IN UINTN Length, OUT UINTN **Offset, OUT UINT8 *NumOfMatchingGuid)
 
EFI_STATUS SearchVfrBinInFfs (IN VOID *Ffs, IN VOID *EfiAddr, IN UINTN Length, OUT UINTN **Offset, OUT UINT8 *NumOfMatchingOffset)
 
BOOLEAN ParseFfs (IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv2, IN EFI_GUID *DriverGuid)
 
VOID ParseFv (IN BOOLEAN ScanAll)
 
VOID CreateVfrDriverList (IN EFI_GUID *DriverGuidArray)
 
VOID DestroyVfrDriverList (VOID)
 
VOID VarCheckHiiGenFromFv (VOID)
 

Variables

EFI_GUID gVfrArrayAttractGuid = EFI_VFR_ATTRACT_GUID
 
EFI_GUID mAllFfGuid = ALL_FF_GUID
 
LIST_ENTRY mVfrDriverList = INITIALIZE_LIST_HEAD_VARIABLE (mVfrDriverList)
 

Detailed Description

Var Check Hii generation from FV.

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

Definition in file VarCheckHiiGenFromFv.c.

Macro Definition Documentation

◆ ALL_FF_GUID

#define ALL_FF_GUID   { 0xFFFFFFFF, 0xFFFF, 0xFFFF, { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } }

Definition at line 17 of file VarCheckHiiGenFromFv.c.

◆ EFI_VFR_ATTRACT_GUID

#define EFI_VFR_ATTRACT_GUID   { 0xd0bc7cb4, 0x6a47, 0x495f, { 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2 } }

Definition at line 12 of file VarCheckHiiGenFromFv.c.

◆ MAX_MATCH_GUID_NUM

#define MAX_MATCH_GUID_NUM   100

Definition at line 34 of file VarCheckHiiGenFromFv.c.

◆ VAR_CHECK_VFR_DRIVER_INFO_FROM_LINK

#define VAR_CHECK_VFR_DRIVER_INFO_FROM_LINK (   a)    CR (a, VAR_CHECK_VFR_DRIVER_INFO, Link, VAR_CHECK_VFR_DRIVER_INFO_SIGNATURE)

Definition at line 32 of file VarCheckHiiGenFromFv.c.

◆ VAR_CHECK_VFR_DRIVER_INFO_SIGNATURE

#define VAR_CHECK_VFR_DRIVER_INFO_SIGNATURE   SIGNATURE_32 ('V', 'D', 'R', 'I')

Definition at line 22 of file VarCheckHiiGenFromFv.c.

Function Documentation

◆ CreateVfrDriverList()

VOID CreateVfrDriverList ( IN EFI_GUID DriverGuidArray)

Create Vfr Driver List.

Parameters
[in]DriverGuidArrayDriver Guid Array

Definition at line 365 of file VarCheckHiiGenFromFv.c.

◆ DestroyVfrDriverList()

VOID DestroyVfrDriverList ( VOID  )

Destroy Vfr Driver List.

Definition at line 387 of file VarCheckHiiGenFromFv.c.

◆ GetAddressByGuid()

EFI_STATUS GetAddressByGuid ( IN VOID *  Ffs,
IN EFI_GUID Guid,
IN UINTN  Length,
OUT UINTN **  Offset,
OUT UINT8 *  NumOfMatchingGuid 
)

Get the address by Guid.

Parse the FFS and find the GUID address. There may be multiple Guids matching the searched Guid.

Parameters
FfsPointer to the FFS.
GuidGuid to find.
LengthThe length of FFS.
OffsetPointer to pointer to the offset.
NumOfMatchingGuidThe number of matching Guid.
Return values
EFI_SUCCESSOne or multiple Guids matching the searched Guid.
EFI_NOT_FOUNDNo Guid matching the searched Guid.

Definition at line 53 of file VarCheckHiiGenFromFv.c.

◆ ParseFfs()

BOOLEAN ParseFfs ( IN EFI_FIRMWARE_VOLUME2_PROTOCOL Fv2,
IN EFI_GUID DriverGuid 
)

Parse FFS.

Parameters
[in]Fv2Pointer to Fv2 protocol.
[in]DriverGuidPointer to driver GUID.
Returns
Found the driver in the FV or not.

Definition at line 164 of file VarCheckHiiGenFromFv.c.

◆ ParseFv()

VOID ParseFv ( IN BOOLEAN  ScanAll)

Parse FVs.

Parameters
[in]ScanAllScan all modules in all FVs or not.

Definition at line 249 of file VarCheckHiiGenFromFv.c.

◆ SearchVfrBinInFfs()

EFI_STATUS SearchVfrBinInFfs ( IN VOID *  Ffs,
IN VOID *  EfiAddr,
IN UINTN  Length,
OUT UINTN **  Offset,
OUT UINT8 *  NumOfMatchingOffset 
)

Search the VfrBin Base address.

According to the known GUID gVfrArrayAttractGuid to get the base address from FFS.

Parameters
FfsPointer to the FFS.
EfiAddrPointer to the EFI in FFS
LengthThe length of FFS.
OffsetPointer to pointer to the Addr (Offset).
NumOfMatchingOffsetThe number of Addr (Offset).
Return values
EFI_SUCCESSGet the address successfully.
EFI_NOT_FOUNDNo VfrBin found.

Definition at line 113 of file VarCheckHiiGenFromFv.c.

◆ VarCheckHiiGenFromFv()

VOID VarCheckHiiGenFromFv ( VOID  )

Generate from FV.

Definition at line 407 of file VarCheckHiiGenFromFv.c.

Variable Documentation

◆ gVfrArrayAttractGuid

EFI_GUID gVfrArrayAttractGuid = EFI_VFR_ATTRACT_GUID

Definition at line 15 of file VarCheckHiiGenFromFv.c.

◆ mAllFfGuid

EFI_GUID mAllFfGuid = ALL_FF_GUID

Definition at line 20 of file VarCheckHiiGenFromFv.c.

◆ mVfrDriverList

LIST_ENTRY mVfrDriverList = INITIALIZE_LIST_HEAD_VARIABLE (mVfrDriverList)

Definition at line 30 of file VarCheckHiiGenFromFv.c.