Path: blob/main/sys/contrib/edk2/Include/Protocol/FirmwareVolume2.h
96339 views
/** @file1The Firmware Volume Protocol provides file-level access to the firmware volume.2Each firmware volume driver must produce an instance of the3Firmware Volume Protocol if the firmware volume is to be visible to4the system during the DXE phase. The Firmware Volume Protocol also provides5mechanisms for determining and modifying some attributes of the firmware volume.67Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>8SPDX-License-Identifier: BSD-2-Clause-Patent910@par Revision Reference: PI11Version 1.00.1213**/1415#ifndef __FIRMWARE_VOLUME2_H__16#define __FIRMWARE_VOLUME2_H__1718#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \19{ 0x220e73b6, 0x6bdb, 0x4413, { 0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a } }2021typedef struct _EFI_FIRMWARE_VOLUME2_PROTOCOL EFI_FIRMWARE_VOLUME2_PROTOCOL;2223///24/// EFI_FV_ATTRIBUTES25///26typedef UINT64 EFI_FV_ATTRIBUTES;2728//29// EFI_FV_ATTRIBUTES bit definitions30//31// EFI_FV_ATTRIBUTES bit semantics32#define EFI_FV2_READ_DISABLE_CAP 0x0000000000000001ULL33#define EFI_FV2_READ_ENABLE_CAP 0x0000000000000002ULL34#define EFI_FV2_READ_STATUS 0x0000000000000004ULL35#define EFI_FV2_WRITE_DISABLE_CAP 0x0000000000000008ULL36#define EFI_FV2_WRITE_ENABLE_CAP 0x0000000000000010ULL37#define EFI_FV2_WRITE_STATUS 0x0000000000000020ULL38#define EFI_FV2_LOCK_CAP 0x0000000000000040ULL39#define EFI_FV2_LOCK_STATUS 0x0000000000000080ULL40#define EFI_FV2_WRITE_POLICY_RELIABLE 0x0000000000000100ULL41#define EFI_FV2_READ_LOCK_CAP 0x0000000000001000ULL42#define EFI_FV2_READ_LOCK_STATUS 0x0000000000002000ULL43#define EFI_FV2_WRITE_LOCK_CAP 0x0000000000004000ULL44#define EFI_FV2_WRITE_LOCK_STATUS 0x0000000000008000ULL45#define EFI_FV2_ALIGNMENT 0x00000000001F0000ULL46#define EFI_FV2_ALIGNMENT_1 0x0000000000000000ULL47#define EFI_FV2_ALIGNMENT_2 0x0000000000010000ULL48#define EFI_FV2_ALIGNMENT_4 0x0000000000020000ULL49#define EFI_FV2_ALIGNMENT_8 0x0000000000030000ULL50#define EFI_FV2_ALIGNMENT_16 0x0000000000040000ULL51#define EFI_FV2_ALIGNMENT_32 0x0000000000050000ULL52#define EFI_FV2_ALIGNMENT_64 0x0000000000060000ULL53#define EFI_FV2_ALIGNMENT_128 0x0000000000070000ULL54#define EFI_FV2_ALIGNMENT_256 0x0000000000080000ULL55#define EFI_FV2_ALIGNMENT_512 0x0000000000090000ULL56#define EFI_FV2_ALIGNMENT_1K 0x00000000000A0000ULL57#define EFI_FV2_ALIGNMENT_2K 0x00000000000B0000ULL58#define EFI_FV2_ALIGNMENT_4K 0x00000000000C0000ULL59#define EFI_FV2_ALIGNMENT_8K 0x00000000000D0000ULL60#define EFI_FV2_ALIGNMENT_16K 0x00000000000E0000ULL61#define EFI_FV2_ALIGNMENT_32K 0x00000000000F0000ULL62#define EFI_FV2_ALIGNMENT_64K 0x0000000000100000ULL63#define EFI_FV2_ALIGNMENT_128K 0x0000000000110000ULL64#define EFI_FV2_ALIGNMENT_256K 0x0000000000120000ULL65#define EFI_FV2_ALIGNMENT_512K 0x0000000000130000ULL66#define EFI_FV2_ALIGNMENT_1M 0x0000000000140000ULL67#define EFI_FV2_ALIGNMENT_2M 0x0000000000150000ULL68#define EFI_FV2_ALIGNMENT_4M 0x0000000000160000ULL69#define EFI_FV2_ALIGNMENT_8M 0x0000000000170000ULL70#define EFI_FV2_ALIGNMENT_16M 0x0000000000180000ULL71#define EFI_FV2_ALIGNMENT_32M 0x0000000000190000ULL72#define EFI_FV2_ALIGNMENT_64M 0x00000000001A0000ULL73#define EFI_FV2_ALIGNMENT_128M 0x00000000001B0000ULL74#define EFI_FV2_ALIGNMENT_256M 0x00000000001C0000ULL75#define EFI_FV2_ALIGNMENT_512M 0x00000000001D0000ULL76#define EFI_FV2_ALIGNMENT_1G 0x00000000001E0000ULL77#define EFI_FV2_ALIGNMENT_2G 0x00000000001F0000ULL7879/**80Returns the attributes and current settings of the firmware volume.8182Because of constraints imposed by the underlying firmware83storage, an instance of the Firmware Volume Protocol may not84be to able to support all possible variations of this85architecture. These constraints and the current state of the86firmware volume are exposed to the caller using the87GetVolumeAttributes() function. GetVolumeAttributes() is88callable only from TPL_NOTIFY and below. Behavior of89GetVolumeAttributes() at any EFI_TPL above TPL_NOTIFY is90undefined.9192@param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.9394@param FvAttributes Pointer to an EFI_FV_ATTRIBUTES in which95the attributes and current settings are96returned.979899@retval EFI_SUCCESS The firmware volume attributes were100returned.101102**/103typedef104EFI_STATUS105(EFIAPI *EFI_FV_GET_ATTRIBUTES)(106IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,107OUT EFI_FV_ATTRIBUTES *FvAttributes108);109110/**111Modifies the current settings of the firmware volume according to the input parameter.112113The SetVolumeAttributes() function is used to set configurable114firmware volume attributes. Only EFI_FV_READ_STATUS,115EFI_FV_WRITE_STATUS, and EFI_FV_LOCK_STATUS may be modified, and116then only in accordance with the declared capabilities. All117other bits of FvAttributes are ignored on input. On successful118return, all bits of *FvAttributes are valid and it contains the119completed EFI_FV_ATTRIBUTES for the volume. To modify an120attribute, the corresponding status bit in the EFI_FV_ATTRIBUTES121is set to the desired value on input. The EFI_FV_LOCK_STATUS bit122does not affect the ability to read or write the firmware123volume. Rather, once the EFI_FV_LOCK_STATUS bit is set, it124prevents further modification to all the attribute bits.125SetVolumeAttributes() is callable only from TPL_NOTIFY and126below. Behavior of SetVolumeAttributes() at any EFI_TPL above127TPL_NOTIFY is undefined.128129@param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.130131@param FvAttributes On input, FvAttributes is a pointer to132an EFI_FV_ATTRIBUTES containing the133desired firmware volume settings. On134successful return, it contains the new135settings of the firmware volume. On136unsuccessful return, FvAttributes is not137modified and the firmware volume138settings are not changed.139140@retval EFI_SUCCESS The requested firmware volume attributes141were set and the resulting142EFI_FV_ATTRIBUTES is returned in143FvAttributes.144145@retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS146is set to 1 on input, but the147device does not support enabling148reads149(FvAttributes:EFI_FV_READ_ENABLE150is clear on return from151GetVolumeAttributes()). Actual152volume attributes are unchanged.153154@retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS155is cleared to 0 on input, but156the device does not support157disabling reads158(FvAttributes:EFI_FV_READ_DISABL159is clear on return from160GetVolumeAttributes()). Actual161volume attributes are unchanged.162163@retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS164is set to 1 on input, but the165device does not support enabling166writes167(FvAttributes:EFI_FV_WRITE_ENABL168is clear on return from169GetVolumeAttributes()). Actual170volume attributes are unchanged.171172@retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS173is cleared to 0 on input, but174the device does not support175disabling writes176(FvAttributes:EFI_FV_WRITE_DISAB177is clear on return from178GetVolumeAttributes()). Actual179volume attributes are unchanged.180181@retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_LOCK_STATUS182is set on input, but the device183does not support locking184(FvAttributes:EFI_FV_LOCK_CAP is185clear on return from186GetVolumeAttributes()). Actual187volume attributes are unchanged.188189@retval EFI_ACCESS_DENIED Device is locked and does not190allow attribute modification191(FvAttributes:EFI_FV_LOCK_STATUS192is set on return from193GetVolumeAttributes()). Actual194volume attributes are unchanged.195196**/197typedef198EFI_STATUS199(EFIAPI *EFI_FV_SET_ATTRIBUTES)(200IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,201IN OUT EFI_FV_ATTRIBUTES *FvAttributes202);203204/**205Retrieves a file and/or file information from the firmware volume.206207ReadFile() is used to retrieve any file from a firmware volume208during the DXE phase. The actual binary encoding of the file in209the firmware volume media may be in any arbitrary format as long210as it does the following: It is accessed using the Firmware211Volume Protocol. The image that is returned follows the image212format defined in Code Definitions: PI Firmware File Format.213If the input value of Buffer==NULL, it indicates the caller is214requesting only that the type, attributes, and size of the215file be returned and that there is no output buffer. In this216case, the following occurs:217- BufferSize is returned with the size that is required to218successfully complete the read.219- The output parameters FoundType and *FileAttributes are220returned with valid values.221- The returned value of *AuthenticationStatus is undefined.222223If the input value of Buffer!=NULL, the output buffer is224specified by a double indirection of the Buffer parameter. The225input value of *Buffer is used to determine if the output226buffer is caller allocated or is dynamically allocated by227ReadFile(). If the input value of *Buffer!=NULL, it indicates228the output buffer is caller allocated. In this case, the input229value of *BufferSize indicates the size of the230caller-allocated output buffer. If the output buffer is not231large enough to contain the entire requested output, it is232filled up to the point that the output buffer is exhausted and233EFI_WARN_BUFFER_TOO_SMALL is returned, and then BufferSize is234returned with the size required to successfully complete the235read. All other output parameters are returned with valid236values. If the input value of *Buffer==NULL, it indicates the237output buffer is to be allocated by ReadFile(). In this case,238ReadFile() will allocate an appropriately sized buffer from239boot services pool memory, which will be returned in Buffer.240The size of the new buffer is returned in BufferSize and all241other output parameters are returned with valid values.242ReadFile() is callable only from TPL_NOTIFY and below.243Behavior of ReadFile() at any EFI_TPL above TPL_NOTIFY is244undefined.245246@param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.247248@param NameGuid Pointer to an EFI_GUID, which is the file249name. All firmware file names are EFI_GUIDs.250A single firmware volume must not have two251valid files with the same file name252EFI_GUID.253254@param Buffer Pointer to a pointer to a buffer in which the255file contents are returned, not including the256file header.257258@param BufferSize Pointer to a caller-allocated UINTN. It259indicates the size of the memory260represented by Buffer.261262@param FoundType Pointer to a caller-allocated EFI_FV_FILETYPE.263264@param FileAttributes Pointer to a caller-allocated265EFI_FV_FILE_ATTRIBUTES.266267@param AuthenticationStatus Pointer to a caller-allocated268UINT32 in which the269authentication status is270returned.271272@retval EFI_SUCCESS The call completed successfully.273274@retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to275contain the requested276output. The buffer is277filled and the output is278truncated.279280@retval EFI_OUT_OF_RESOURCES An allocation failure occurred.281282@retval EFI_NOT_FOUND Name was not found in the firmware volume.283284@retval EFI_DEVICE_ERROR A hardware error occurred when285attempting to access the firmware volume.286287@retval EFI_ACCESS_DENIED The firmware volume is configured to288disallow reads.289290**/291typedef292EFI_STATUS293(EFIAPI *EFI_FV_READ_FILE)(294IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,295IN CONST EFI_GUID *NameGuid,296IN OUT VOID **Buffer,297IN OUT UINTN *BufferSize,298OUT EFI_FV_FILETYPE *FoundType,299OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,300OUT UINT32 *AuthenticationStatus301);302303/**304Locates the requested section within a file and returns it in a buffer.305306ReadSection() is used to retrieve a specific section from a file307within a firmware volume. The section returned is determined308using a depth-first, left-to-right search algorithm through all309sections found in the specified file. The output buffer is specified by a double indirection310of the Buffer parameter. The input value of Buffer is used to311determine if the output buffer is caller allocated or is312dynamically allocated by ReadSection(). If the input value of313Buffer!=NULL, it indicates that the output buffer is caller314allocated. In this case, the input value of *BufferSize315indicates the size of the caller-allocated output buffer. If316the output buffer is not large enough to contain the entire317requested output, it is filled up to the point that the output318buffer is exhausted and EFI_WARN_BUFFER_TOO_SMALL is returned,319and then BufferSize is returned with the size that is required320to successfully complete the read. All other321output parameters are returned with valid values. If the input322value of *Buffer==NULL, it indicates the output buffer is to323be allocated by ReadSection(). In this case, ReadSection()324will allocate an appropriately sized buffer from boot services325pool memory, which will be returned in *Buffer. The size of326the new buffer is returned in *BufferSize and all other output327parameters are returned with valid values. ReadSection() is328callable only from TPL_NOTIFY and below. Behavior of329ReadSection() at any EFI_TPL above TPL_NOTIFY is330undefined.331332@param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.333334@param NameGuid Pointer to an EFI_GUID, which indicates the335file name from which the requested section336will be read.337338@param SectionType Indicates the section type to return.339SectionType in conjunction with340SectionInstance indicates which section to341return.342343@param SectionInstance Indicates which instance of sections344with a type of SectionType to return.345SectionType in conjunction with346SectionInstance indicates which347section to return. SectionInstance is348zero based.349350@param Buffer Pointer to a pointer to a buffer in which the351section contents are returned, not including352the section header.353354@param BufferSize Pointer to a caller-allocated UINTN. It355indicates the size of the memory356represented by Buffer.357358@param AuthenticationStatus Pointer to a caller-allocated359UINT32 in which the authentication360status is returned.361362363@retval EFI_SUCCESS The call completed successfully.364365@retval EFI_WARN_BUFFER_TOO_SMALL The caller-allocated366buffer is too small to367contain the requested368output. The buffer is369filled and the output is370truncated.371372@retval EFI_OUT_OF_RESOURCES An allocation failure occurred.373374@retval EFI_NOT_FOUND The requested file was not found in375the firmware volume. EFI_NOT_FOUND The376requested section was not found in the377specified file.378379@retval EFI_DEVICE_ERROR A hardware error occurred when380attempting to access the firmware381volume.382383@retval EFI_ACCESS_DENIED The firmware volume is configured to384disallow reads. EFI_PROTOCOL_ERROR385The requested section was not found,386but the file could not be fully387parsed because a required388GUIDED_SECTION_EXTRACTION_PROTOCOL389was not found. It is possible the390requested section exists within the391file and could be successfully392extracted once the required393GUIDED_SECTION_EXTRACTION_PROTOCOL394is published.395396**/397typedef398EFI_STATUS399(EFIAPI *EFI_FV_READ_SECTION)(400IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,401IN CONST EFI_GUID *NameGuid,402IN EFI_SECTION_TYPE SectionType,403IN UINTN SectionInstance,404IN OUT VOID **Buffer,405IN OUT UINTN *BufferSize,406OUT UINT32 *AuthenticationStatus407);408409///410/// EFI_FV_WRITE_POLICY, two policies (unreliable write and reliable write) are defined.411///412typedef UINT32 EFI_FV_WRITE_POLICY;413#define EFI_FV_UNRELIABLE_WRITE 0x00000000414#define EFI_FV_RELIABLE_WRITE 0x00000001415416//417// EFI_FV_WRITE_FILE_DATA418//419typedef struct {420///421/// Pointer to a GUID, which is the file name to be written.422///423EFI_GUID *NameGuid;424///425/// Indicates the type of file to be written.426///427EFI_FV_FILETYPE Type;428///429/// Indicates the attributes for the file to be written.430///431EFI_FV_FILE_ATTRIBUTES FileAttributes;432///433/// Pointer to a buffer containing the file to be written.434///435VOID *Buffer;436///437/// Indicates the size of the file image contained in Buffer.438///439UINT32 BufferSize;440} EFI_FV_WRITE_FILE_DATA;441442/**443Locates the requested section within a file and returns it in a buffer.444445WriteFile() is used to write one or more files to a firmware446volume. Each file to be written is described by an447EFI_FV_WRITE_FILE_DATA structure. The caller must ensure that448any required alignment for all files listed in the FileData449array is compatible with the firmware volume. Firmware volume450capabilities can be determined using the GetVolumeAttributes()451call. Similarly, if the WritePolicy is set to452EFI_FV_RELIABLE_WRITE, the caller must check the firmware volume453capabilities to ensure EFI_FV_RELIABLE_WRITE is supported by the454firmware volume. EFI_FV_UNRELIABLE_WRITE must always be455supported. Writing a file with a size of zero456(FileData[n].BufferSize == 0) deletes the file from the firmware457volume if it exists. Deleting a file must be done one at a time.458Deleting a file as part of a multiple file write is not allowed.459Platform Initialization Specification VOLUME 3 Shared460Architectural Elements 84 August 21, 2006 Version 1.0461WriteFile() is callable only from TPL_NOTIFY and below.462Behavior of WriteFile() at any EFI_TPL above TPL_NOTIFY is463undefined.464465@param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.466467@param NumberOfFiles Indicates the number of elements in the array pointed to by FileData468469@param WritePolicy Indicates the level of reliability for the470write in the event of a power failure or471other system failure during the write472operation.473474@param FileData Pointer to an array of475EFI_FV_WRITE_FILE_DATA. Each element of476FileData[] represents a file to be written.477478479@retval EFI_SUCCESS The write completed successfully.480481@retval EFI_OUT_OF_RESOURCES The firmware volume does not482have enough free space to483storefile(s).484485@retval EFI_DEVICE_ERROR A hardware error occurred when486attempting to access the firmware volume.487488@retval EFI_WRITE_PROTECTED The firmware volume is489configured to disallow writes.490491@retval EFI_NOT_FOUND A delete was requested, but the492requested file was not found in the493firmware volume.494495@retval EFI_INVALID_PARAMETER A delete was requested with a496multiple file write.497498@retval EFI_INVALID_PARAMETER An unsupported WritePolicy was499requested.500501@retval EFI_INVALID_PARAMETER An unknown file type was502specified.503504@retval EFI_INVALID_PARAMETER A file system specific error505has occurred.506507**/508typedef509EFI_STATUS510(EFIAPI *EFI_FV_WRITE_FILE)(511IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,512IN UINT32 NumberOfFiles,513IN EFI_FV_WRITE_POLICY WritePolicy,514IN EFI_FV_WRITE_FILE_DATA *FileData515);516517/**518Retrieves information about the next file in the firmware volume store519that matches the search criteria.520521GetNextFile() is the interface that is used to search a firmware522volume for a particular file. It is called successively until523the desired file is located or the function returns524EFI_NOT_FOUND. To filter uninteresting files from the output,525the type of file to search for may be specified in FileType. For526example, if *FileType is EFI_FV_FILETYPE_DRIVER, only files of527this type will be returned in the output. If *FileType is528EFI_FV_FILETYPE_ALL, no filtering of file types is done. The Key529parameter is used to indicate a starting point of the search. If530the buffer *Key is completely initialized to zero, the search531re-initialized and starts at the beginning. Subsequent calls to532GetNextFile() must maintain the value of *Key returned by the533immediately previous call. The actual contents of *Key are534implementation specific and no semantic content is implied.535GetNextFile() is callable only from TPL_NOTIFY and below.536Behavior of GetNextFile() at any EFI_TPL above TPL_NOTIFY is537undefined.538539@param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.540541@param Key Pointer to a caller-allocated buffer that contains implementation-specific data that is542used to track where to begin the search for the next file. The size of the buffer must be543at least This->KeySize bytes long. To re-initialize the search and begin from the544beginning of the firmware volume, the entire buffer must be cleared to zero. Other545than clearing the buffer to initiate a new search, the caller must not modify the data in546the buffer between calls to GetNextFile().547548@param FileType Pointer to a caller-allocated549EFI_FV_FILETYPE. The GetNextFile() API can550filter its search for files based on the551value of the FileType input. A *FileType552input of EFI_FV_FILETYPE_ALL causes553GetNextFile() to search for files of all554types. If a file is found, the file's type555is returned in FileType. *FileType is not556modified if no file is found.557558@param NameGuid Pointer to a caller-allocated EFI_GUID. If a559matching file is found, the file's name is560returned in NameGuid. If no matching file is561found, *NameGuid is not modified.562563@param Attributes Pointer to a caller-allocated564EFI_FV_FILE_ATTRIBUTES. If a matching file565is found, the file's attributes are returned566in Attributes. If no matching file is found,567Attributes is not modified. Type568EFI_FV_FILE_ATTRIBUTES is defined in569ReadFile().570571@param Size Pointer to a caller-allocated UINTN. If a572matching file is found, the file's size is573returned in *Size. If no matching file is found,574Size is not modified.575576@retval EFI_SUCCESS The output parameters are filled with data577obtained from the first matching file that578was found.579580@retval FI_NOT_FOUND No files of type FileType were found.581582583@retval EFI_DEVICE_ERROR A hardware error occurred when584attempting to access the firmware585volume.586587@retval EFI_ACCESS_DENIED The firmware volume is configured to588disallow reads.589590591**/592typedef593EFI_STATUS594(EFIAPI *EFI_FV_GET_NEXT_FILE)(595IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,596IN OUT VOID *Key,597IN OUT EFI_FV_FILETYPE *FileType,598OUT EFI_GUID *NameGuid,599OUT EFI_FV_FILE_ATTRIBUTES *Attributes,600OUT UINTN *Size601);602603/**604Return information about a firmware volume.605606The GetInfo() function returns information of type607InformationType for the requested firmware volume. If the volume608does not support the requested information type, then609EFI_UNSUPPORTED is returned. If the buffer is not large enough610to hold the requested structure, EFI_BUFFER_TOO_SMALL is611returned and the BufferSize is set to the size of buffer that is612required to make the request. The information types defined by613this specification are required information types that all file614systems must support.615616@param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL617instance that is the file handle the requested618information is for.619620@param InformationType The type identifier for the621information being requested.622623@param BufferSize On input, the size of Buffer. On output,624the amount of data returned in Buffer. In625both cases, the size is measured in bytes.626627@param Buffer A pointer to the data buffer to return. The628buffer's type is indicated by InformationType.629630631@retval EFI_SUCCESS The information was retrieved.632633@retval EFI_UNSUPPORTED The InformationType is not known.634635@retval EFI_NO_MEDIA The device has no medium.636637@retval EFI_DEVICE_ERROR The device reported an error.638639@retval EFI_VOLUME_CORRUPTED The file system structures are640corrupted.641642@retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to643read the current directory644entry. BufferSize has been645updated with the size needed to646complete the request.647648649**/650typedef651EFI_STATUS652(EFIAPI *EFI_FV_GET_INFO)(653IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,654IN CONST EFI_GUID *InformationType,655IN OUT UINTN *BufferSize,656OUT VOID *Buffer657);658659/**660Sets information about a firmware volume.661662The SetInfo() function sets information of type InformationType663on the requested firmware volume.664665666@param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL667instance that is the file handle the information668is for.669670@param InformationType The type identifier for the671information being set.672673@param BufferSize The size, in bytes, of Buffer.674675@param Buffer A pointer to the data buffer to write. The676buffer's type is indicated by InformationType.677678@retval EFI_SUCCESS The information was set.679680@retval EFI_UNSUPPORTED The InformationType is not known.681682@retval EFI_NO_MEDIA The device has no medium.683684@retval EFI_DEVICE_ERROR The device reported an error.685686@retval EFI_VOLUME_CORRUPTED The file system structures are687corrupted.688689690@retval EFI_WRITE_PROTECTED The media is read only.691692@retval EFI_VOLUME_FULL The volume is full.693694@retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the695size of the type indicated by696InformationType.697698**/699typedef700EFI_STATUS701(EFIAPI *EFI_FV_SET_INFO)(702IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,703IN CONST EFI_GUID *InformationType,704IN UINTN BufferSize,705IN CONST VOID *Buffer706);707708///709/// The Firmware Volume Protocol contains the file-level710/// abstraction to the firmware volume as well as some firmware711/// volume attribute reporting and configuration services. The712/// Firmware Volume Protocol is the interface used by all parts of713/// DXE that are not directly involved with managing the firmware714/// volume itself. This abstraction allows many varied types of715/// firmware volume implementations. A firmware volume may be a716/// flash device or it may be a file in the UEFI system partition,717/// for example. This level of firmware volume implementation718/// detail is not visible to the consumers of the Firmware Volume719/// Protocol.720///721struct _EFI_FIRMWARE_VOLUME2_PROTOCOL {722EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;723EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;724EFI_FV_READ_FILE ReadFile;725EFI_FV_READ_SECTION ReadSection;726EFI_FV_WRITE_FILE WriteFile;727EFI_FV_GET_NEXT_FILE GetNextFile;728729///730/// Data field that indicates the size in bytes731/// of the Key input buffer for the732/// GetNextFile() API.733///734UINT32 KeySize;735736///737/// Handle of the parent firmware volume.738///739EFI_HANDLE ParentHandle;740EFI_FV_GET_INFO GetInfo;741EFI_FV_SET_INFO SetInfo;742};743744extern EFI_GUID gEfiFirmwareVolume2ProtocolGuid;745746#endif747748749