OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
FirmwareVolume.h File Reference

Go to the source code of this file.

Data Structures

struct  FRAMEWORK_EFI_FV_WRITE_FILE_DATA
 
struct  _EFI_FIRMWARE_VOLUME_PROTOCOL
 

Macros

#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID
 
#define FV_DEVICE_SIGNATURE   SIGNATURE_32 ('_', 'F', 'V', '_')
 
#define EFI_FV_READ_DISABLE_CAP   0x0000000000000001ULL
 
#define EFI_FV_READ_ENABLE_CAP   0x0000000000000002ULL
 
#define EFI_FV_READ_STATUS   0x0000000000000004ULL
 
#define EFI_FV_WRITE_DISABLE_CAP   0x0000000000000008ULL
 
#define EFI_FV_WRITE_ENABLE_CAP   0x0000000000000010ULL
 
#define EFI_FV_WRITE_STATUS   0x0000000000000020ULL
 
#define EFI_FV_LOCK_CAP   0x0000000000000040ULL
 
#define EFI_FV_LOCK_STATUS   0x0000000000000080ULL
 
#define EFI_FV_WRITE_POLICY_RELIABLE   0x0000000000000100ULL
 
#define EFI_FV_ALIGNMENT_CAP   0x0000000000008000ULL
 
#define EFI_FV_ALIGNMENT_2   0x0000000000010000ULL
 
#define EFI_FV_ALIGNMENT_4   0x0000000000020000ULL
 
#define EFI_FV_ALIGNMENT_8   0x0000000000040000ULL
 
#define EFI_FV_ALIGNMENT_16   0x0000000000080000ULL
 
#define EFI_FV_ALIGNMENT_32   0x0000000000100000ULL
 
#define EFI_FV_ALIGNMENT_64   0x0000000000200000ULL
 
#define EFI_FV_ALIGNMENT_128   0x0000000000400000ULL
 
#define EFI_FV_ALIGNMENT_256   0x0000000000800000ULL
 
#define EFI_FV_ALIGNMENT_512   0x0000000001000000ULL
 
#define EFI_FV_ALIGNMENT_1K   0x0000000002000000ULL
 
#define EFI_FV_ALIGNMENT_2K   0x0000000004000000ULL
 
#define EFI_FV_ALIGNMENT_4K   0x0000000008000000ULL
 
#define EFI_FV_ALIGNMENT_8K   0x0000000010000000ULL
 
#define EFI_FV_ALIGNMENT_16K   0x0000000020000000ULL
 
#define EFI_FV_ALIGNMENT_32K   0x0000000040000000ULL
 
#define EFI_FV_ALIGNMENT_64K   0x0000000080000000ULL
 
#define FRAMEWORK_EFI_FV_UNRELIABLE_WRITE   0x00000000
 
#define FRAMEWORK_EFI_FV_RELIABLE_WRITE   0x00000001
 

Typedefs

typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL
 
typedef UINT64 FRAMEWORK_EFI_FV_ATTRIBUTES
 
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_GET_ATTRIBUTES) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes)
 
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_SET_ATTRIBUTES) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes)
 
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_READ_FILE) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN EFI_GUID *NameGuid, IN OUT VOID **Buffer, IN OUT UINTN *BufferSize, OUT EFI_FV_FILETYPE *FoundType, OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes, OUT UINT32 *AuthenticationStatus)
 
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_READ_SECTION) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, IN OUT VOID **Buffer, IN OUT UINTN *BufferSize, OUT UINT32 *AuthenticationStatus)
 
typedef UINT32 FRAMEWORK_EFI_FV_WRITE_POLICY
 
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_WRITE_FILE) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN UINT32 NumberOfFiles, IN FRAMEWORK_EFI_FV_WRITE_POLICY WritePolicy, IN FRAMEWORK_EFI_FV_WRITE_FILE_DATA *FileData)
 
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_GET_NEXT_FILE) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN OUT VOID *Key, IN OUT EFI_FV_FILETYPE *FileType, OUT EFI_GUID *NameGuid, OUT EFI_FV_FILE_ATTRIBUTES *Attributes, OUT UINTN *Size)
 

Variables

EFI_GUID gEfiFirmwareVolumeProtocolGuid
 

Detailed Description

This file declares the Firmware Volume Protocol.

The Firmware Volume Protocol provides file-level access to the firmware volume. Each firmware volume driver must produce an instance of the Firmware Volume Protocol if the firmware volume is to be visible to the system. The Firmware Volume Protocol also provides mechanisms for determining and modifying some attributes of the firmware volume.

Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Revision Reference:
This protocol is defined in Firmware Volume specification. Version 0.9.

Definition in file FirmwareVolume.h.

Macro Definition Documentation

◆ EFI_FIRMWARE_VOLUME_PROTOCOL_GUID

#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID
Value:
{ \
0x389F751F, 0x1838, 0x4388, {0x83, 0x90, 0xCD, 0x81, 0x54, 0xBD, 0x27, 0xF8 } \
}

Definition at line 31 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_128

#define EFI_FV_ALIGNMENT_128   0x0000000000400000ULL

Definition at line 69 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_16

#define EFI_FV_ALIGNMENT_16   0x0000000000080000ULL

Definition at line 66 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_16K

#define EFI_FV_ALIGNMENT_16K   0x0000000020000000ULL

Definition at line 76 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_1K

#define EFI_FV_ALIGNMENT_1K   0x0000000002000000ULL

Definition at line 72 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_2

#define EFI_FV_ALIGNMENT_2   0x0000000000010000ULL

Definition at line 63 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_256

#define EFI_FV_ALIGNMENT_256   0x0000000000800000ULL

Definition at line 70 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_2K

#define EFI_FV_ALIGNMENT_2K   0x0000000004000000ULL

Definition at line 73 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_32

#define EFI_FV_ALIGNMENT_32   0x0000000000100000ULL

Definition at line 67 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_32K

#define EFI_FV_ALIGNMENT_32K   0x0000000040000000ULL

Definition at line 77 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_4

#define EFI_FV_ALIGNMENT_4   0x0000000000020000ULL

Definition at line 64 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_4K

#define EFI_FV_ALIGNMENT_4K   0x0000000008000000ULL

Definition at line 74 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_512

#define EFI_FV_ALIGNMENT_512   0x0000000001000000ULL

Definition at line 71 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_64

#define EFI_FV_ALIGNMENT_64   0x0000000000200000ULL

Definition at line 68 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_64K

#define EFI_FV_ALIGNMENT_64K   0x0000000080000000ULL

Definition at line 78 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_8

#define EFI_FV_ALIGNMENT_8   0x0000000000040000ULL

Definition at line 65 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_8K

#define EFI_FV_ALIGNMENT_8K   0x0000000010000000ULL

Definition at line 75 of file FirmwareVolume.h.

◆ EFI_FV_ALIGNMENT_CAP

#define EFI_FV_ALIGNMENT_CAP   0x0000000000008000ULL

Definition at line 62 of file FirmwareVolume.h.

◆ EFI_FV_LOCK_CAP

#define EFI_FV_LOCK_CAP   0x0000000000000040ULL

Definition at line 58 of file FirmwareVolume.h.

◆ EFI_FV_LOCK_STATUS

#define EFI_FV_LOCK_STATUS   0x0000000000000080ULL

Definition at line 59 of file FirmwareVolume.h.

◆ EFI_FV_READ_DISABLE_CAP

#define EFI_FV_READ_DISABLE_CAP   0x0000000000000001ULL

Definition at line 50 of file FirmwareVolume.h.

◆ EFI_FV_READ_ENABLE_CAP

#define EFI_FV_READ_ENABLE_CAP   0x0000000000000002ULL

Definition at line 51 of file FirmwareVolume.h.

◆ EFI_FV_READ_STATUS

#define EFI_FV_READ_STATUS   0x0000000000000004ULL

Definition at line 52 of file FirmwareVolume.h.

◆ EFI_FV_WRITE_DISABLE_CAP

#define EFI_FV_WRITE_DISABLE_CAP   0x0000000000000008ULL

Definition at line 54 of file FirmwareVolume.h.

◆ EFI_FV_WRITE_ENABLE_CAP

#define EFI_FV_WRITE_ENABLE_CAP   0x0000000000000010ULL

Definition at line 55 of file FirmwareVolume.h.

◆ EFI_FV_WRITE_POLICY_RELIABLE

#define EFI_FV_WRITE_POLICY_RELIABLE   0x0000000000000100ULL

Definition at line 60 of file FirmwareVolume.h.

◆ EFI_FV_WRITE_STATUS

#define EFI_FV_WRITE_STATUS   0x0000000000000020ULL

Definition at line 56 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_RELIABLE_WRITE

#define FRAMEWORK_EFI_FV_RELIABLE_WRITE   0x00000001

Definition at line 221 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_UNRELIABLE_WRITE

#define FRAMEWORK_EFI_FV_UNRELIABLE_WRITE   0x00000000

Definition at line 220 of file FirmwareVolume.h.

◆ FV_DEVICE_SIGNATURE

#define FV_DEVICE_SIGNATURE   SIGNATURE_32 ('_', 'F', 'V', '_')

Definition at line 36 of file FirmwareVolume.h.

Typedef Documentation

◆ EFI_FIRMWARE_VOLUME_PROTOCOL

◆ FRAMEWORK_EFI_FV_ATTRIBUTES

Definition at line 43 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_GET_ATTRIBUTES

typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_GET_ATTRIBUTES) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes)

Retrieves attributes, insures positive polarity of attribute bits, and returns resulting attributes in an output parameter.

Parameters
ThisIndicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance.
AttributesOutput buffer containing attributes.
Return values
EFI_SUCCESSThe firmware volume attributes were returned.

Definition at line 94 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_GET_NEXT_FILE

typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_GET_NEXT_FILE) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN OUT VOID *Key, IN OUT EFI_FV_FILETYPE *FileType, OUT EFI_GUID *NameGuid, OUT EFI_FV_FILE_ATTRIBUTES *Attributes, OUT UINTN *Size)

Given the input key, search for the next matching file in the volume.

Parameters
ThisIndicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance.
KeyPointer to a caller allocated buffer that contains an implementation-specific key that is used to track where to begin searching on successive calls.
FileTypeThe pointer to the file type to filter for.
NameGuidThe pointer to Guid filename of the file found.
AttributesThe pointer to Attributes of the file found.
SizeThe pointer to Size in bytes of the file found.
Return values
EFI_SUCCESSThe output parameters are filled with data obtained from the first matching file that was found.
EFI_NOT_FOUNDNo files of type FileType were found.
EFI_DEVICE_ERRORA hardware error occurred when attempting to access the firmware volume.
EFI_ACCESS_DENIEDThe firmware volume is configured to disallow reads.

Definition at line 287 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_READ_FILE

typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_READ_FILE) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN EFI_GUID *NameGuid, IN OUT VOID **Buffer, IN OUT UINTN *BufferSize, OUT EFI_FV_FILETYPE *FoundType, OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes, OUT UINT32 *AuthenticationStatus)

Read the requested file (NameGuid) or file information from the firmware volume and returns data in Buffer.

Parameters
ThisThe EFI_FIRMWARE_VOLUME_PROTOCOL instance.
NameGuidThe pointer to EFI_GUID, which is the filename of the file to read.
BufferThe pointer to pointer to buffer in which contents of file are returned.
If Buffer is NULL, only type, attributes, and size are returned as there is no output buffer.
If Buffer != NULL and *Buffer == NULL, the output buffer is allocated from BS pool by ReadFile.
If Buffer != NULL and *Buffer != NULL, the output buffer has been allocated by the caller and is being passed in.
BufferSizeOn input: The buffer size. On output: The size required to complete the read.
FoundTypeThe pointer to the type of the file whose data is returned.
FileAttributesThe pointer to attributes of the file whose data is returned.
AuthenticationStatusThe pointer to the authentication status of the data.
Return values
EFI_SUCCESSThe call completed successfully.
EFI_WARN_BUFFER_TOO_SMALLThe buffer is too small to contain the requested output. The buffer filled, and the output is truncated.
EFI_NOT_FOUNDNameGuid was not found in the firmware volume.
EFI_DEVICE_ERRORA hardware error occurred when attempting to access the firmware volume.
EFI_ACCESS_DENIEDThe firmware volume is configured to disallow reads.
EFI_OUT_OF_RESOURCESAn allocation failure occurred.

Definition at line 162 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_READ_SECTION

typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_READ_SECTION) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, IN OUT VOID **Buffer, IN OUT UINTN *BufferSize, OUT UINT32 *AuthenticationStatus)

Read the requested section from the specified file and returns data in Buffer.

Parameters
ThisIndicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance.
NameGuidFilename identifying the file from which to read.
SectionTypeThe section type to retrieve.
SectionInstanceThe instance of SectionType to retrieve.
BufferPointer to pointer to buffer in which contents of a file are returned.
If Buffer is NULL, only type, attributes, and size are returned as there is no output buffer.
If Buffer != NULL and *Buffer == NULL, the output buffer is allocated from BS pool by ReadFile.
If Buffer != NULL and *Buffer != NULL, the output buffer has been allocated by the caller and is being passed in.
BufferSizeThe pointer to the buffer size passed in, and on output the size required to complete the read.
AuthenticationStatusThe pointer to the authentication status of the data.
Return values
EFI_SUCCESSThe call completed successfully.
EFI_WARN_BUFFER_TOO_SMALLThe buffer is too small to contain the requested output. The buffer is filled and the output is truncated.
EFI_OUT_OF_RESOURCESAn allocation failure occurred.
EFI_NOT_FOUNDThe name was not found in the firmware volume.
EFI_DEVICE_ERRORA hardware error occurred when attempting to access the firmware volume.
EFI_ACCESS_DENIEDThe firmware volume is configured to disallow reads.

Definition at line 207 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_SET_ATTRIBUTES

typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_SET_ATTRIBUTES) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes)

Sets volume attributes

Parameters
ThisIndicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance.
AttributesOn input, Attributes is a pointer to an EFI_FV_ATTRIBUTES containing the desired firmware volume settings. On successful return, it contains the new settings of the firmware volume. On unsuccessful return, Attributes is not modified and the firmware volume settings are not changed.
Return values
EFI_INVALID_PARAMETERA bit in Attributes was invalid.
EFI_SUCCESSThe requested firmware volume attributes were set and the resulting EFI_FV_ATTRIBUTES is returned in Attributes.
EFI_ACCESS_DENIEDThe Device is locked and does not permit modification.

Definition at line 119 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_WRITE_FILE

typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_FV_WRITE_FILE) (IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN UINT32 NumberOfFiles, IN FRAMEWORK_EFI_FV_WRITE_POLICY WritePolicy, IN FRAMEWORK_EFI_FV_WRITE_FILE_DATA *FileData)

Write the supplied file (NameGuid) to the FV.

Parameters
ThisIndicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance.
NumberOfFilesIndicates the number of file records pointed to by FileData.
WritePolicyIndicates the level of reliability of the write with respect to things like power failure events.
FileDataA pointer to an array of EFI_FV_WRITE_FILE_DATA structures. Each element in the array indicates a file to write, and there are NumberOfFiles elements in the input array.
Return values
EFI_SUCCESSThe write completed successfully.
EFI_OUT_OF_RESOURCESThe firmware volume does not have enough free space to store file(s).
EFI_DEVICE_ERRORA hardware error occurred when attempting to access the firmware volume.
EFI_WRITE_PROTECTEDThe firmware volume is configured to disallow writes.
EFI_NOT_FOUNDA delete was requested, but the requested file was not found in the firmware volume.
EFI_INVALID_PARAMETERA delete was requested with a multiple file write. An unsupported WritePolicy was requested. An unknown file type was specified. A file system specific error has occurred.

Definition at line 258 of file FirmwareVolume.h.

◆ FRAMEWORK_EFI_FV_WRITE_POLICY

Definition at line 218 of file FirmwareVolume.h.

Variable Documentation

◆ gEfiFirmwareVolumeProtocolGuid

EFI_GUID gEfiFirmwareVolumeProtocolGuid
extern