X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFrameworkPkg%2FInclude%2FProtocol%2FFirmwareVolume.h;h=c2a7246ca28df7fb2098703ba280b406ebaf98e9;hb=2cec3ea527edfeb1257703ccbe804f292acaf0d1;hp=50c53d5e2ef9c5bd41c5b7735973f307683f82c6;hpb=79964ac84ea0ca6c68d0dea38245fa83ff1945d1;p=mirror_edk2.git diff --git a/IntelFrameworkPkg/Include/Protocol/FirmwareVolume.h b/IntelFrameworkPkg/Include/Protocol/FirmwareVolume.h index 50c53d5e2e..c2a7246ca2 100644 --- a/IntelFrameworkPkg/Include/Protocol/FirmwareVolume.h +++ b/IntelFrameworkPkg/Include/Protocol/FirmwareVolume.h @@ -1,7 +1,13 @@ /** @file - This file declares Firmware Volume protocol. + 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, Intel Corporation + Copyright (c) 2007 - 2009, 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 which accompanies this distribution. The full text of the license may be found at @@ -10,8 +16,6 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - Module Name: FirmwareVolume.h - @par Revision Reference: This protocol is defined in Firmware Volume specification. Version 0.9 @@ -21,6 +25,7 @@ #ifndef _FIRMWARE_VOLUME_H_ #define _FIRMWARE_VOLUME_H_ +#include // // Firmware Volume Protocol GUID definition @@ -30,18 +35,18 @@ 0x389F751F, 0x1838, 0x4388, {0x83, 0x90, 0xCD, 0x81, 0x54, 0xBD, 0x27, 0xF8 } \ } -#define FV_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', '_') +#define FV_DEVICE_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', '_') typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL; // -// EFI_FV_ATTRIBUTES bit definitions +// FRAMEWORK_EFI_FV_ATTRIBUTES bit definitions // -typedef UINT64 EFI_FV_ATTRIBUTES; +typedef UINT64 FRAMEWORK_EFI_FV_ATTRIBUTES; // // ************************************************************ -// EFI_FV_ATTRIBUTES bit definitions +// FRAMEWORK_EFI_FV_ATTRIBUTES bit definitions // ************************************************************ // #define EFI_FV_READ_DISABLE_CAP 0x0000000000000001ULL @@ -82,47 +87,49 @@ typedef UINT64 EFI_FV_ATTRIBUTES; Retrieves attributes, insures positive polarity of attribute bits, returns resulting attributes in output parameter - @param This Calling context + @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. @param Attributes output buffer which contains attributes - @retval EFI_INVALID_PARAMETER - @retval EFI_SUCCESS - + @retval EFI_SUCCESS The firmware volume attributes were returned. **/ typedef EFI_STATUS -(EFIAPI *EFI_FV_GET_ATTRIBUTES) ( - IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, - OUT EFI_FV_ATTRIBUTES *Attributes +(EFIAPI *FRAMEWORK_EFI_FV_GET_ATTRIBUTES)( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes ); /** Sets volume attributes - @param This Calling context - @param Attributes Buffer which contains attributes + @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. + @param Attributes On input, Attributes is a pointer to an + EFI_FV_ATTRIBUTES containing the desired firmware + volume settings.O n 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. - @retval EFI_INVALID_PARAMETER - @retval EFI_DEVICE_ERROR - @retval EFI_SUCCESS + @retval EFI_INVALID_PARAMETER A bit in Attributes was invalid + @retval EFI_SUCCESS The requested firmware volume attributes were set + and the resulting EFI_FV_ATTRIBUTES is returned in + Attributes. + @retval EFI_ACCESS_DENIED the Device is locked and does not permit modification. **/ typedef EFI_STATUS -(EFIAPI *EFI_FV_SET_ATTRIBUTES) ( - IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, - IN OUT EFI_FV_ATTRIBUTES *Attributes +(EFIAPI *FRAMEWORK_EFI_FV_SET_ATTRIBUTES)( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes ); -typedef UINT32 EFI_FV_FILE_ATTRIBUTES; - -#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F - /** - Read the requested file (NameGuid) and returns data in Buffer. + Read the requested file (NameGuid) or file information from the firmware volume + and returns data in Buffer. - @param This Calling context - @param NameGuid Filename identifying which file to read + @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. + @param NameGuid pointer to EFI_GUID which is the filename identifying which file to read @param Buffer Pointer to pointer to buffer in which contents of file are returned.
If Buffer is NULL, only type, attributes, and size are returned as @@ -135,20 +142,22 @@ typedef UINT32 EFI_FV_FILE_ATTRIBUTES; allocated by the caller and is being passed in. @param BufferSize Indicates the buffer size passed in, and on output the size required to complete the read - @param FoundType Indicates the type of the file who's data is returned - @param FileAttributes Indicates the attributes of the file who's data is resturned - @param AuthenticationStatus Indicates the authentication status of the data - - @retval EFI_SUCCESS - @retval EFI_WARN_BUFFER_TOO_SMALL - @retval EFI_NOT_FOUND - @retval EFI_DEVICE_ERROR - @retval EFI_ACCESS_DENIED + @param FoundType pointer to type of the file who's data is returned + @param FileAttributes pointer to attributes of the file who's data is resturned + @param AuthenticationStatus pointer to authentication status of the data + + @retval EFI_SUCCESS The call completed successfully + @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to contain the requested output. + The buffer is filled and the output is truncated. + @retval EFI_NOT_FOUND NameGuid was not found int he firmware volume. + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access the firmware volume. + @retval EFI_ACCESS_DENIED The firmware volumen is configured to disallow reads. + @retval EFI_OUT_OF_RESOURCES An allocation failure occurred. **/ typedef EFI_STATUS -(EFIAPI *EFI_FV_READ_FILE) ( +(EFIAPI *FRAMEWORK_EFI_FV_READ_FILE)( IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN EFI_GUID *NameGuid, IN OUT VOID **Buffer, @@ -161,7 +170,7 @@ EFI_STATUS /** Read the requested section from the specified file and returns data in Buffer. - @param This Calling context + @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. @param NameGuid Filename identifying the file from which to read @param SectionType Indicates what section type to retrieve @param SectionInstance Indicates which instance of SectionType to retrieve @@ -175,21 +184,22 @@ EFI_STATUS
If Buffer != NULL and *Buffer != NULL, the output buffer has been allocated by the caller and is being passed in. - @param BufferSize Indicates the buffer size passed in, and on output the size + @param BufferSize pointer to the buffer size passed in, and on output the size required to complete the read - @param AuthenticationStatus Indicates the authentication status of the data + @param AuthenticationStatus pointer to the authentication status of the data - @retval EFI_SUCCESS - @retval EFI_WARN_BUFFER_TOO_SMALL - @retval EFI_OUT_OF_RESOURCES - @retval EFI_NOT_FOUND - @retval EFI_DEVICE_ERROR - @retval EFI_ACCESS_DENIED + @retval EFI_SUCCESS The call completed successfully. + @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to contain the requested output. + The buffer is filled and the output is truncated. + @retval EFI_OUT_OF_RESOURCES An allocation failure occurred. + @retval EFI_NOT_FOUND Name was not found in the firmware volume. + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access the firmware volume. + @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. **/ typedef EFI_STATUS -(EFIAPI *EFI_FV_READ_SECTION) ( +(EFIAPI *FRAMEWORK_EFI_FV_READ_SECTION)( IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, @@ -199,10 +209,10 @@ EFI_STATUS OUT UINT32 *AuthenticationStatus ); -typedef UINT32 EFI_FV_WRITE_POLICY; +typedef UINT32 FRAMEWORK_EFI_FV_WRITE_POLICY; -#define EFI_FV_UNRELIABLE_WRITE 0x00000000 -#define EFI_FV_RELIABLE_WRITE 0x00000001 +#define FRAMEWORK_EFI_FV_UNRELIABLE_WRITE 0x00000000 +#define FRAMEWORK_EFI_FV_RELIABLE_WRITE 0x00000001 typedef struct { EFI_GUID *NameGuid; @@ -210,12 +220,12 @@ typedef struct { EFI_FV_FILE_ATTRIBUTES FileAttributes; VOID *Buffer; UINT32 BufferSize; -} EFI_FV_WRITE_FILE_DATA; +} FRAMEWORK_EFI_FV_WRITE_FILE_DATA; /** Write the supplied file (NameGuid) to the FV. - @param This Calling context + @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. @param NumberOfFiles Indicates the number of file records pointed to by FileData @param WritePolicy Indicates the level of reliability of the write with respect to things like power failure events. @@ -223,44 +233,49 @@ typedef struct { element in the array indicates a file to write, and there are NumberOfFiles elements in the input array. - @retval EFI_SUCCESS - @retval EFI_OUT_OF_RESOURCES - @retval EFI_DEVICE_ERROR - @retval EFI_WRITE_PROTECTED - @retval EFI_NOT_FOUND - @retval EFI_INVALID_PARAMETER - + @retval EFI_SUCCESS The write completed successfully. + @retval EFI_OUT_OF_RESOURCES The firmware volume does not have enough free space to store file(s). + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access the firmware volume. + @retval EFI_WRITE_PROTECTED The firmware volume is configured to disallow writes. + @retval EFI_NOT_FOUND A delete was requested, but the requested file was not + found in the firmware volume. + @retval EFI_INVALID_PARAMETER A 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. **/ typedef EFI_STATUS -(EFIAPI *EFI_FV_WRITE_FILE) ( - IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, - IN UINT32 NumberOfFiles, - IN EFI_FV_WRITE_POLICY WritePolicy, - IN EFI_FV_WRITE_FILE_DATA *FileData +(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 ); /** Given the input key, search for the next matching file in the volume. - @param This Calling context + @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. @param Key Pointer to a caller allocated buffer that contains an implementation specific key that is used to track where to begin searching on successive calls. - @param FileType Indicates the file type to filter for - @param NameGuid Guid filename of the file found - @param Attributes Attributes of the file found - @param Size Size in bytes of the file found - - @retval EFI_SUCCESS - @retval EFI_NOT_FOUND - @retval EFI_DEVICE_ERROR - @retval EFI_ACCESS_DENIED + @param FileType pointer to the file type to filter for + @param NameGuid pointer to Guid filename of the file found + @param Attributes pointer to Attributes of the file found + @param Size pointer to Size in bytes of the file found + + @retval EFI_SUCCESS The output parameters are filled with data obtained from + the first matching file that was found. + @retval EFI_NOT_FOUND No files of type FileType were found. + @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access + the firmware volume. + @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. **/ typedef EFI_STATUS -(EFIAPI *EFI_FV_GET_NEXT_FILE) ( +(EFIAPI *FRAMEWORK_EFI_FV_GET_NEXT_FILE)( IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, IN OUT VOID *Key, IN OUT EFI_FV_FILETYPE *FileType, @@ -269,48 +284,49 @@ EFI_STATUS OUT UINTN *Size ); -/** - @par Protocol Description: - 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. - - @param GetVolumeAttributes - Retrieves volume capabilities and current settings. - - @param SetVolumeAttributes - Modifies the current settings of the firmware volume. - - @param ReadFile - Reads an entire file from the firmware volume. - - @param ReadSection - Reads a single section from a file into a buffer. - - @param WriteFile - Writes an entire file into the firmware volume. - - @param GetNextFile - Provides service to allow searching the firmware volume. - - @param KeySize - Data field that indicates the size in bytes of the Key input buffer for - the GetNextFile() API. - - @param ParentHandle - Handle of the parent firmware volume. - -**/ +// +// Protocol interface structure +// struct _EFI_FIRMWARE_VOLUME_PROTOCOL { - EFI_FV_GET_ATTRIBUTES GetVolumeAttributes; - EFI_FV_SET_ATTRIBUTES SetVolumeAttributes; - EFI_FV_READ_FILE ReadFile; - EFI_FV_READ_SECTION ReadSection; - EFI_FV_WRITE_FILE WriteFile; - EFI_FV_GET_NEXT_FILE GetNextFile; + /// + /// Retrieves volume capabilities and current settings. + /// + FRAMEWORK_EFI_FV_GET_ATTRIBUTES GetVolumeAttributes; + + /// + /// Modifies the current settings of the firmware volume. + /// + FRAMEWORK_EFI_FV_SET_ATTRIBUTES SetVolumeAttributes; + + /// + /// Reads an entire file from the firmware volume. + /// + FRAMEWORK_EFI_FV_READ_FILE ReadFile; + + /// + /// Reads a single section from a file into a buffer. + /// + FRAMEWORK_EFI_FV_READ_SECTION ReadSection; + + /// + /// Writes an entire file into the firmware volume. + /// + FRAMEWORK_EFI_FV_WRITE_FILE WriteFile; + + /// + /// Provides service to allow searching the firmware volume. + /// + FRAMEWORK_EFI_FV_GET_NEXT_FILE GetNextFile; + + /// + /// Data field that indicates the size in bytes of the Key input buffer for + /// the GetNextFile() API. + /// UINT32 KeySize; + + /// + /// Handle of the parent firmware volume. + /// EFI_HANDLE ParentHandle; };