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

Go to the source code of this file.

Data Structures

struct  LOAD_FILE_ON_FV2_PRIVATE_DATA
 

Macros

#define LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE   SIGNATURE_32 ('l', 'f', 'f', 'v')
 
#define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_THIS(a)   CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, LoadFile, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)
 
#define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_LINK(a)   CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, Link, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)
 

Functions

EFI_STATUS EFIAPI LoadFileOnFv2LoadFile (IN EFI_LOAD_FILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)
 
BOOLEAN EFIAPI IsInPrivateList (IN EFI_GUID *NameGuid)
 
EFI_DEVICE_PATH_PROTOCOL *EFIAPI CreateFileDevicePath (IN EFI_HANDLE Device, IN EFI_GUID *NameGuid, IN CONST CHAR16 *FileName)
 
VOID EFIAPI InstallFileLoadProtocol (EFI_HANDLE Handle)
 
VOID EFIAPI FvNotificationEvent (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI LoadFileOnFv2Intialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

VOID * mFvRegistration
 
LIST_ENTRY mPrivateDataList
 
LOAD_FILE_ON_FV2_PRIVATE_DATA mLoadFileOnFv2PrivateDataTemplate
 

Detailed Description

Produce Load File Protocol for UEFI Applications in Firmware Volumes

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

Definition in file LoadFileOnFv2.c.

Macro Definition Documentation

◆ LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_LINK

#define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_LINK (   a)    CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, Link, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)

Definition at line 37 of file LoadFileOnFv2.c.

◆ LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_THIS

#define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_THIS (   a)    CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, LoadFile, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)

Definition at line 36 of file LoadFileOnFv2.c.

◆ LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE

#define LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE   SIGNATURE_32 ('l', 'f', 'f', 'v')

Definition at line 25 of file LoadFileOnFv2.c.

Function Documentation

◆ CreateFileDevicePath()

EFI_DEVICE_PATH_PROTOCOL *EFIAPI CreateFileDevicePath ( IN EFI_HANDLE  Device,
IN EFI_GUID NameGuid,
IN CONST CHAR16 *  FileName 
)

Create file device path based on FFS file GUID and UI name.

Parameters
DeviceHandle to Firmware Volume.
NameGuidPoint to FFS file GUID.
FileNamePoint to FFS UI section name.
Returns
the combined device path

Definition at line 195 of file LoadFileOnFv2.c.

◆ FvNotificationEvent()

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

This notification function is invoked when an instance of the LzmaCustomDecompressGuid is produced. It installs another instance of the EFI_FIRMWARE_VOLUME_PROTOCOL on the handle of the FFS. This notification function also handles the situation when LZMA decoder driver loaded later than FirmwareVolume driver.

Parameters
EventThe event that occurred
ContextContext of event. Not used in this nofication function.

Definition at line 330 of file LoadFileOnFv2.c.

◆ InstallFileLoadProtocol()

VOID EFIAPI InstallFileLoadProtocol ( EFI_HANDLE  Handle)

Install LoadFile Protocol for Application FFS.

Parameters
HandleFV Handle.

Definition at line 238 of file LoadFileOnFv2.c.

◆ IsInPrivateList()

BOOLEAN EFIAPI IsInPrivateList ( IN EFI_GUID NameGuid)

Check if the FFS has been installed LoadFileProtocol for it.

Parameters
[in]NameGuidPoint to FFS File GUID to be checked.
Return values
TRUEThe FFS's FileLoadProtocol is in list.
FALSEThe FFS's FileLoadProtocol is not in list.

Definition at line 162 of file LoadFileOnFv2.c.

◆ LoadFileOnFv2Intialize()

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

Entry point function initializes global variables and installs notifications.

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 402 of file LoadFileOnFv2.c.

◆ LoadFileOnFv2LoadFile()

EFI_STATUS EFIAPI LoadFileOnFv2LoadFile ( IN EFI_LOAD_FILE_PROTOCOL This,
IN EFI_DEVICE_PATH_PROTOCOL FilePath,
IN BOOLEAN  BootPolicy,
IN OUT UINTN BufferSize,
IN VOID *Buffer  OPTIONAL 
)

Causes the driver to load a specified file from firmware volume.

Parameters
[in]ThisProtocol instance pointer.
[in]FilePathThe device specific path of the file to load.
[in]BootPolicyIf TRUE, indicates that the request originates from the boot manager is attempting to load FilePath as a boot selection. If FALSE, then FilePath must match an exact file to be loaded.
[in,out]BufferSizeOn input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file.
[in]BufferThe memory buffer to transfer the file to. IF Buffer is NULL, then no the size of the requested file is returned in BufferSize.
Return values
EFI_SUCCESSThe file was loaded.
EFI_UNSUPPORTEDThe device does not support the provided BootPolicy.
EFI_INVALID_PARAMETERFilePath is not a valid device path, or BufferSize is NULL.
EFI_DEVICE_ERRORThe file was not loaded due to a device error.
EFI_NOT_FOUNDThe file was not found.
EFI_OUT_OF_RESOURCESAn allocation failure occurred.
EFI_ACCESS_DENIEDThe firmware volume is configured to disallow reads.

Definition at line 71 of file LoadFileOnFv2.c.

Variable Documentation

◆ mFvRegistration

VOID* mFvRegistration

Definition at line 39 of file LoadFileOnFv2.c.

◆ mLoadFileOnFv2PrivateDataTemplate

LOAD_FILE_ON_FV2_PRIVATE_DATA mLoadFileOnFv2PrivateDataTemplate
Initial value:
= {
LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE,
{
}
}
EFI_STATUS EFIAPI LoadFileOnFv2LoadFile(IN EFI_LOAD_FILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)
Definition: LoadFileOnFv2.c:71

Definition at line 144 of file LoadFileOnFv2.c.

◆ mPrivateDataList

LIST_ENTRY mPrivateDataList

Definition at line 40 of file LoadFileOnFv2.c.