2008-05-09 09:08:30 +02:00
|
|
|
/** @file
|
2007-12-10 04:47:56 +01:00
|
|
|
Firmware File System protocol. Layers on top of Firmware
|
|
|
|
Block protocol to produce a file abstraction of FV based files.
|
2008-05-21 03:40:12 +02:00
|
|
|
|
|
|
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
|
|
|
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
|
|
|
|
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.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2007-12-10 04:47:56 +01:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
#ifndef __FW_VOL_DRIVER_H_
|
|
|
|
#define __FW_VOL_DRIVER_H_
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2007-09-04 08:12:48 +02:00
|
|
|
#define FV2_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', '2')
|
|
|
|
|
2007-07-04 12:51:54 +02:00
|
|
|
//
|
|
|
|
// Used to track all non-deleted files
|
|
|
|
//
|
|
|
|
typedef struct {
|
|
|
|
LIST_ENTRY Link;
|
|
|
|
EFI_FFS_FILE_HEADER *FfsHeader;
|
|
|
|
UINTN StreamHandle;
|
|
|
|
} FFS_FILE_LIST_ENTRY;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINTN Signature;
|
|
|
|
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
|
|
|
|
EFI_HANDLE Handle;
|
2007-09-04 08:12:48 +02:00
|
|
|
EFI_FIRMWARE_VOLUME2_PROTOCOL Fv;
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;
|
|
|
|
UINT8 *CachedFv;
|
|
|
|
UINT8 *EndOfCachedFv;
|
|
|
|
|
|
|
|
FFS_FILE_LIST_ENTRY *LastKey;
|
|
|
|
|
|
|
|
LIST_ENTRY FfsFileListHeader;
|
|
|
|
|
|
|
|
UINT8 ErasePolarity;
|
|
|
|
} FV_DEVICE;
|
|
|
|
|
2007-09-04 08:12:48 +02:00
|
|
|
#define FV_DEVICE_FROM_THIS(a) CR(a, FV_DEVICE, Fv, FV2_DEVICE_SIGNATURE)
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Retrieves attributes, insures positive polarity of attribute bits, returns
|
|
|
|
resulting attributes in output parameter.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@param This Calling context
|
|
|
|
@param Attributes output buffer which contains attributes
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully got volume attributes
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvGetVolumeAttributes (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
|
|
|
OUT EFI_FV_ATTRIBUTES *Attributes
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Sets current attributes for volume
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@param This Calling context
|
|
|
|
@param Attributes At input, contains attributes to be set. At output
|
|
|
|
contains new value of FV
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@retval EFI_UNSUPPORTED Could not be set.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvSetVolumeAttributes (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
|
|
|
IN OUT EFI_FV_ATTRIBUTES *Attributes
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Given the input key, search for the next matching file in the volume.
|
|
|
|
|
|
|
|
@param This Indicates the calling context.
|
|
|
|
@param Key Key is a pointer to a caller allocated
|
|
|
|
buffer that contains implementation specific
|
|
|
|
data that is used to track where to begin
|
|
|
|
the search for the next file. The size of
|
|
|
|
the buffer must be at least This->KeySize
|
|
|
|
bytes long. To reinitialize the search and
|
|
|
|
begin from the beginning of the firmware
|
|
|
|
volume, the entire buffer must be cleared to
|
|
|
|
zero. Other than clearing the buffer to
|
|
|
|
initiate a new search, the caller must not
|
|
|
|
modify the data in the buffer between calls
|
|
|
|
to GetNextFile().
|
|
|
|
@param FileType FileType is a pointer to a caller allocated
|
|
|
|
EFI_FV_FILETYPE. The GetNextFile() API can
|
|
|
|
filter it's search for files based on the
|
|
|
|
value of *FileType input. A *FileType input
|
|
|
|
of 0 causes GetNextFile() to search for
|
|
|
|
files of all types. If a file is found, the
|
|
|
|
file's type is returned in *FileType.
|
|
|
|
*FileType is not modified if no file is
|
|
|
|
found.
|
|
|
|
@param NameGuid NameGuid is a pointer to a caller allocated
|
|
|
|
EFI_GUID. If a file is found, the file's
|
|
|
|
name is returned in *NameGuid. *NameGuid is
|
|
|
|
not modified if no file is found.
|
|
|
|
@param Attributes Attributes is a pointer to a caller
|
|
|
|
allocated EFI_FV_FILE_ATTRIBUTES. If a file
|
|
|
|
is found, the file's attributes are returned
|
|
|
|
in *Attributes. *Attributes is not modified
|
|
|
|
if no file is found.
|
|
|
|
@param Size Size is a pointer to a caller allocated
|
|
|
|
UINTN. If a file is found, the file's size
|
|
|
|
is returned in *Size. *Size is not modified
|
|
|
|
if no file is found.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully find the file.
|
|
|
|
@retval EFI_DEVICE_ERROR Device error.
|
|
|
|
@retval EFI_ACCESS_DENIED Fv could not read.
|
|
|
|
@retval EFI_NOT_FOUND No matching file found.
|
|
|
|
@retval EFI_INVALID_PARAMETER Invalid parameter
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvGetNextFile (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_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
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Locates a file in the firmware volume and
|
|
|
|
copies it to the supplied buffer.
|
|
|
|
|
|
|
|
@param This Indicates the calling context.
|
|
|
|
@param NameGuid Pointer to an EFI_GUID, which is the
|
|
|
|
filename.
|
|
|
|
@param Buffer Buffer is a pointer to pointer to a buffer
|
|
|
|
in which the file or section contents or are
|
|
|
|
returned.
|
|
|
|
@param BufferSize BufferSize is a pointer to caller allocated
|
|
|
|
UINTN. On input *BufferSize indicates the
|
|
|
|
size in bytes of the memory region pointed
|
|
|
|
to by Buffer. On output, *BufferSize
|
|
|
|
contains the number of bytes required to
|
|
|
|
read the file.
|
|
|
|
@param FoundType FoundType is a pointer to a caller allocated
|
|
|
|
EFI_FV_FILETYPE that on successful return
|
|
|
|
from Read() contains the type of file read.
|
|
|
|
This output reflects the file type
|
|
|
|
irrespective of the value of the SectionType
|
|
|
|
input.
|
|
|
|
@param FileAttributes FileAttributes is a pointer to a caller
|
|
|
|
allocated EFI_FV_FILE_ATTRIBUTES. On
|
|
|
|
successful return from Read(),
|
|
|
|
*FileAttributes contains the attributes of
|
|
|
|
the file read.
|
|
|
|
@param AuthenticationStatus AuthenticationStatus is a pointer to a
|
|
|
|
caller allocated UINTN in which the
|
|
|
|
authentication status is returned.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully read to memory buffer.
|
|
|
|
@retval EFI_WARN_BUFFER_TOO_SMALL Buffer too small.
|
|
|
|
@retval EFI_NOT_FOUND Not found.
|
|
|
|
@retval EFI_DEVICE_ERROR Device error.
|
|
|
|
@retval EFI_ACCESS_DENIED Could not read.
|
|
|
|
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Not enough buffer to be allocated.
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvReadFile (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
|
|
|
IN CONST 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
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Locates a section in a given FFS File and
|
|
|
|
copies it to the supplied buffer (not including section header).
|
|
|
|
|
|
|
|
@param This Indicates the calling context.
|
|
|
|
@param NameGuid Pointer to an EFI_GUID, which is the
|
|
|
|
filename.
|
|
|
|
@param SectionType Indicates the section type to return.
|
|
|
|
@param SectionInstance Indicates which instance of sections with a
|
|
|
|
type of SectionType to return.
|
|
|
|
@param Buffer Buffer is a pointer to pointer to a buffer
|
|
|
|
in which the file or section contents or are
|
|
|
|
returned.
|
|
|
|
@param BufferSize BufferSize is a pointer to caller allocated
|
|
|
|
UINTN.
|
|
|
|
@param AuthenticationStatus AuthenticationStatus is a pointer to a
|
|
|
|
caller allocated UINT32 in which the
|
|
|
|
authentication status is returned.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully read the file section into
|
|
|
|
buffer.
|
|
|
|
@retval EFI_WARN_BUFFER_TOO_SMALL Buffer too small.
|
|
|
|
@retval EFI_NOT_FOUND Section not found.
|
|
|
|
@retval EFI_DEVICE_ERROR Device error.
|
|
|
|
@retval EFI_ACCESS_DENIED Could not read.
|
|
|
|
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvReadFileSection (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
2007-09-04 08:12:48 +02:00
|
|
|
IN CONST EFI_GUID *NameGuid,
|
|
|
|
IN EFI_SECTION_TYPE SectionType,
|
|
|
|
IN UINTN SectionInstance,
|
|
|
|
IN OUT VOID **Buffer,
|
|
|
|
IN OUT UINTN *BufferSize,
|
|
|
|
OUT UINT32 *AuthenticationStatus
|
2008-05-21 03:40:12 +02:00
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Writes one or more files to the firmware volume.
|
|
|
|
|
|
|
|
@param This Indicates the calling context.
|
|
|
|
@param NumberOfFiles Number of files.
|
|
|
|
@param WritePolicy WritePolicy indicates the level of reliability
|
|
|
|
for the write in the event of a power failure or
|
|
|
|
other system failure during the write operation.
|
|
|
|
@param FileData FileData is an pointer to an array of
|
|
|
|
EFI_FV_WRITE_DATA. Each element of array
|
|
|
|
FileData represents a file to be written.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Files successfully written to firmware volume
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Not enough buffer to be allocated.
|
|
|
|
@retval EFI_DEVICE_ERROR Device error.
|
|
|
|
@retval EFI_WRITE_PROTECTED Write protected.
|
|
|
|
@retval EFI_NOT_FOUND Not found.
|
|
|
|
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
|
|
|
@retval EFI_UNSUPPORTED This function not supported.
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvWriteFile (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
|
|
|
IN UINT32 NumberOfFiles,
|
|
|
|
IN EFI_FV_WRITE_POLICY WritePolicy,
|
|
|
|
IN EFI_FV_WRITE_FILE_DATA *FileData
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return information of type InformationType for the requested firmware
|
|
|
|
volume.
|
|
|
|
|
|
|
|
@param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
|
|
|
|
@param InformationType InformationType for requested.
|
|
|
|
@param BufferSize On input, size of Buffer.On output, the amount of data
|
|
|
|
returned in Buffer.
|
|
|
|
@param Buffer A poniter to the data buffer to return.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully got volume Information.
|
|
|
|
|
|
|
|
**/
|
2007-09-04 08:12:48 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvGetVolumeInfo (
|
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
|
|
|
IN CONST EFI_GUID *InformationType,
|
2008-05-21 03:40:12 +02:00
|
|
|
IN OUT UINTN *BufferSize,
|
|
|
|
OUT VOID *Buffer
|
|
|
|
);
|
2007-09-04 08:12:48 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set information of type InformationType for the requested firmware
|
2007-09-04 08:12:48 +02:00
|
|
|
volume.
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
|
|
|
|
@param InformationType InformationType for requested.
|
|
|
|
@param BufferSize On input, size of Buffer.On output, the amount of data
|
|
|
|
returned in Buffer.
|
|
|
|
@param Buffer A poniter to the data buffer to return.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully set volume Information.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-09-04 08:12:48 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
FvSetVolumeInfo (
|
|
|
|
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
|
|
|
IN CONST EFI_GUID *InformationType,
|
2008-05-21 03:40:12 +02:00
|
|
|
IN UINTN BufferSize,
|
|
|
|
IN CONST VOID *Buffer
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
//Internal functions
|
|
|
|
//
|
|
|
|
typedef enum {
|
|
|
|
EfiCheckSumUint8 = 0,
|
|
|
|
EfiCheckSumUint16 = 1,
|
|
|
|
EfiCheckSumUint32 = 2,
|
|
|
|
EfiCheckSumUint64 = 3,
|
|
|
|
EfiCheckSumMaximum = 4
|
|
|
|
} EFI_CHECKSUM_TYPE;
|
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Check if a block of buffer is erased.
|
|
|
|
|
|
|
|
@param ErasePolarity Erase polarity attribute of the firmware volume
|
|
|
|
@param InBuffer The buffer to be checked
|
|
|
|
@param BufferSize Size of the buffer in bytes
|
|
|
|
|
|
|
|
@retval TRUE The block of buffer is erased
|
|
|
|
@retval FALSE The block of buffer is not erased
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
BOOLEAN
|
|
|
|
IsBufferErased (
|
|
|
|
IN UINT8 ErasePolarity,
|
2008-05-21 03:40:12 +02:00
|
|
|
IN VOID *InBuffer,
|
2007-07-04 12:51:54 +02:00
|
|
|
IN UINTN BufferSize
|
2008-05-21 03:40:12 +02:00
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Get the FFS file state by checking the highest bit set in the header's state field.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@param ErasePolarity Erase polarity attribute of the firmware volume
|
|
|
|
@param FfsHeader Points to the FFS file header
|
|
|
|
|
|
|
|
@return FFS File state
|
|
|
|
|
|
|
|
**/
|
2008-05-21 03:40:12 +02:00
|
|
|
EFI_FFS_FILE_STATE
|
2007-07-04 12:51:54 +02:00
|
|
|
GetFileState (
|
|
|
|
IN UINT8 ErasePolarity,
|
|
|
|
IN EFI_FFS_FILE_HEADER *FfsHeader
|
2008-05-21 03:40:12 +02:00
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Set the FFS file state.
|
|
|
|
|
|
|
|
@param State The state to be set.
|
|
|
|
@param FfsHeader Points to the FFS file header
|
|
|
|
|
|
|
|
@return None.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
VOID
|
|
|
|
SetFileState (
|
|
|
|
IN UINT8 State,
|
|
|
|
IN EFI_FFS_FILE_HEADER *FfsHeader
|
2008-05-21 03:40:12 +02:00
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Verify checksum of the firmware volume header.
|
|
|
|
|
|
|
|
@param FvHeader Points to the firmware volume header to be checked
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@retval TRUE Checksum verification passed
|
|
|
|
@retval FALSE Checksum verification failed
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
BOOLEAN
|
|
|
|
VerifyFvHeaderChecksum (
|
|
|
|
IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader
|
2008-05-21 03:40:12 +02:00
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Check if it's a valid FFS file header.
|
|
|
|
|
|
|
|
@param ErasePolarity Erase polarity attribute of the firmware volume
|
|
|
|
@param FfsHeader Points to the FFS file header to be checked
|
|
|
|
@param FileState FFS file state to be returned
|
|
|
|
|
|
|
|
@retval TRUE Valid FFS file header
|
|
|
|
@retval FALSE Invalid FFS file header
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
BOOLEAN
|
|
|
|
IsValidFfsHeader (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN UINT8 ErasePolarity,
|
|
|
|
IN EFI_FFS_FILE_HEADER *FfsHeader,
|
|
|
|
OUT EFI_FFS_FILE_STATE *FileState
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Check if it's a valid FFS file.
|
|
|
|
Here we are sure that it has a valid FFS file header since we must call IsValidFfsHeader() first.
|
|
|
|
|
|
|
|
@param ErasePolarity Erase polarity attribute of the firmware volume
|
|
|
|
@param FfsHeader Points to the FFS file to be checked
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@retval TRUE Valid FFS file
|
|
|
|
@retval FALSE Invalid FFS file
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
BOOLEAN
|
|
|
|
IsValidFfsFile (
|
|
|
|
IN UINT8 ErasePolarity,
|
|
|
|
IN EFI_FFS_FILE_HEADER *FfsHeader
|
2008-05-21 03:40:12 +02:00
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
given the supplied FW_VOL_BLOCK_PROTOCOL, allocate a buffer for output and
|
|
|
|
copy the volume header into it.
|
|
|
|
|
|
|
|
@param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to
|
|
|
|
read the volume header
|
|
|
|
@param FwVolHeader Pointer to pointer to allocated buffer in which
|
|
|
|
the volume header is returned.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.
|
|
|
|
@retval EFI_SUCCESS Successfully read volume header to the allocated
|
|
|
|
buffer.
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
GetFwVolHeader (
|
2008-05-21 03:40:12 +02:00
|
|
|
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb,
|
|
|
|
OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
|
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Check if a FV is consistent and allocate cache
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@param FvDevice pointer to the FvDevice to be checked.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.
|
|
|
|
@retval EFI_SUCCESS FV is consistent and cache is allocated.
|
|
|
|
@retval EFI_VOLUME_CORRUPTED File system is corrupted.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
EFI_STATUS
|
|
|
|
FvCheck (
|
|
|
|
IN OUT FV_DEVICE *FvDevice
|
2008-05-21 03:40:12 +02:00
|
|
|
);
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
#endif
|