TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Guid/LzmaDecompress.h>
#include <Protocol/LoadFile.h>
#include <Protocol/DevicePath.h>
#include <Protocol/FirmwareVolume2.h>
#include <Protocol/FirmwareVolumeBlock.h>
#include <Library/DebugLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DevicePathLib.h>
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 |
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.
#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.
#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.
#define LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('l', 'f', 'f', 'v') |
Definition at line 25 of file LoadFileOnFv2.c.
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.
Device | Handle to Firmware Volume. |
NameGuid | Point to FFS file GUID. |
FileName | Point to FFS UI section name. |
Definition at line 195 of file LoadFileOnFv2.c.
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.
Event | The event that occurred |
Context | Context of event. Not used in this nofication function. |
Definition at line 330 of file LoadFileOnFv2.c.
VOID EFIAPI InstallFileLoadProtocol | ( | EFI_HANDLE | Handle | ) |
Install LoadFile Protocol for Application FFS.
Handle | FV Handle. |
Definition at line 238 of file LoadFileOnFv2.c.
Check if the FFS has been installed LoadFileProtocol for it.
[in] | NameGuid | Point to FFS File GUID to be checked. |
TRUE | The FFS's FileLoadProtocol is in list. |
FALSE | The FFS's FileLoadProtocol is not in list. |
Definition at line 162 of file LoadFileOnFv2.c.
EFI_STATUS EFIAPI LoadFileOnFv2Intialize | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Entry point function initializes global variables and installs notifications.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
other | Some error occurs when executing this entry point. |
Definition at line 402 of file LoadFileOnFv2.c.
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.
[in] | This | Protocol instance pointer. |
[in] | FilePath | The device specific path of the file to load. |
[in] | BootPolicy | If 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] | BufferSize | On 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] | Buffer | The memory buffer to transfer the file to. IF Buffer is NULL, then no the size of the requested file is returned in BufferSize. |
EFI_SUCCESS | The file was loaded. |
EFI_UNSUPPORTED | The device does not support the provided BootPolicy. |
EFI_INVALID_PARAMETER | FilePath is not a valid device path, or BufferSize is NULL. |
EFI_DEVICE_ERROR | The file was not loaded due to a device error. |
EFI_NOT_FOUND | The file was not found. |
EFI_OUT_OF_RESOURCES | An allocation failure occurred. |
EFI_ACCESS_DENIED | The firmware volume is configured to disallow reads. |
Definition at line 71 of file LoadFileOnFv2.c.
VOID* mFvRegistration |
Definition at line 39 of file LoadFileOnFv2.c.
LOAD_FILE_ON_FV2_PRIVATE_DATA mLoadFileOnFv2PrivateDataTemplate |
Definition at line 144 of file LoadFileOnFv2.c.
LIST_ENTRY mPrivateDataList |
Definition at line 40 of file LoadFileOnFv2.c.