Add doxygen style comments for functions in DxeMain.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5189 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -19,24 +19,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define PHYSICAL_ADDRESS_TO_POINTER(Address) ((VOID *)((UINTN)(Address)))
|
||||
|
||||
|
||||
/**
|
||||
Get the FFS file state by checking the highest bit set in the header's state field.
|
||||
|
||||
@param ErasePolarity Erase polarity attribute of the firmware volume
|
||||
@param FfsHeader Points to the FFS file header
|
||||
|
||||
@return FFS File state
|
||||
|
||||
**/
|
||||
EFI_FFS_FILE_STATE
|
||||
GetFileState (
|
||||
IN UINT8 ErasePolarity,
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Get the FFS file state by checking the highest bit set in the header's state field
|
||||
|
||||
Arguments:
|
||||
ErasePolarity - Erase polarity attribute of the firmware volume
|
||||
FfsHeader - Points to the FFS file header
|
||||
|
||||
Returns:
|
||||
FFS File state
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_FFS_FILE_STATE FileState;
|
||||
UINT8 HighestBit;
|
||||
@@ -56,27 +52,24 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
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
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsBufferErased (
|
||||
IN UINT8 ErasePolarity,
|
||||
IN VOID *InBuffer,
|
||||
IN UINTN BufferSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Check if a block of buffer is erased
|
||||
|
||||
Arguments:
|
||||
ErasePolarity - Erase polarity attribute of the firmware volume
|
||||
InBuffer - The buffer to be checked
|
||||
BufferSize - Size of the buffer in bytes
|
||||
|
||||
Returns:
|
||||
TRUE - The block of buffer is erased
|
||||
FALSE - The block of buffer is not erased
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Count;
|
||||
UINT8 EraseByte;
|
||||
@@ -99,35 +92,32 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Verify checksum of the firmware volume header.
|
||||
|
||||
@param FvHeader Points to the firmware volume header to be checked
|
||||
|
||||
@retval TRUE Checksum verification passed
|
||||
@retval FALSE Checksum verification failed
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
VerifyFvHeaderChecksum (
|
||||
IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Verify checksum of the firmware volume header
|
||||
|
||||
Arguments:
|
||||
FvHeader - Points to the firmware volume header to be checked
|
||||
|
||||
Returns:
|
||||
TRUE - Checksum verification passed
|
||||
FALSE - Checksum verification failed
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT32 HeaderLength;
|
||||
UINT16 Checksum;
|
||||
UINT16 *ptr;
|
||||
UINT16 *Ptr;
|
||||
|
||||
HeaderLength = FvHeader->HeaderLength;
|
||||
ptr = (UINT16 *)FvHeader;
|
||||
Ptr = (UINT16 *)FvHeader;
|
||||
Checksum = 0;
|
||||
|
||||
for (Index = 0; Index < HeaderLength / sizeof (UINT16); Index++) {
|
||||
Checksum = (UINT16)(Checksum + ptr[Index]);
|
||||
Checksum = (UINT16)(Checksum + Ptr[Index]);
|
||||
}
|
||||
|
||||
if (Checksum == 0) {
|
||||
@@ -137,33 +127,30 @@ Returns:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Verify checksum of the FFS file header.
|
||||
|
||||
@param FfsHeader Points to the FFS file header to be checked
|
||||
|
||||
@retval TRUE Checksum verification passed
|
||||
@retval FALSE Checksum verification failed
|
||||
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
VerifyHeaderChecksum (
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Verify checksum of the FFS file header
|
||||
|
||||
Arguments:
|
||||
FfsHeader - Points to the FFS file header to be checked
|
||||
|
||||
Returns:
|
||||
TRUE - Checksum verification passed
|
||||
FALSE - Checksum verification failed
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT8 *ptr;
|
||||
UINT8 *Ptr;
|
||||
UINT8 HeaderChecksum;
|
||||
|
||||
ptr = (UINT8 *)FfsHeader;
|
||||
Ptr = (UINT8 *)FfsHeader;
|
||||
HeaderChecksum = 0;
|
||||
for (Index = 0; Index < sizeof(EFI_FFS_FILE_HEADER); Index++) {
|
||||
HeaderChecksum = (UINT8)(HeaderChecksum + ptr[Index]);
|
||||
HeaderChecksum = (UINT8)(HeaderChecksum + Ptr[Index]);
|
||||
}
|
||||
|
||||
HeaderChecksum = (UINT8) (HeaderChecksum - FfsHeader->State - FfsHeader->IntegrityCheck.Checksum.File);
|
||||
@@ -176,27 +163,24 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
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
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidFfsHeader (
|
||||
IN UINT8 ErasePolarity,
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader,
|
||||
OUT EFI_FFS_FILE_STATE *FileState
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Check if it's a valid FFS file header
|
||||
|
||||
Arguments:
|
||||
ErasePolarity - Erase polarity attribute of the firmware volume
|
||||
FfsHeader - Points to the FFS file header to be checked
|
||||
FileState - FFS file state to be returned
|
||||
|
||||
Returns:
|
||||
TRUE - Valid FFS file header
|
||||
FALSE - Invalid FFS file header
|
||||
|
||||
--*/
|
||||
{
|
||||
*FileState = GetFileState (ErasePolarity, FfsHeader);
|
||||
|
||||
@@ -218,26 +202,23 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
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
|
||||
|
||||
@retval TRUE Valid FFS file
|
||||
@retval FALSE Invalid FFS file
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidFfsFile (
|
||||
IN UINT8 ErasePolarity,
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
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.
|
||||
|
||||
Arguments:
|
||||
ErasePolarity - Erase polarity attribute of the firmware volume
|
||||
FfsHeader - Points to the FFS file to be checked
|
||||
|
||||
Returns:
|
||||
TRUE - Valid FFS file
|
||||
FALSE - Invalid FFS file
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_FFS_FILE_STATE FileState;
|
||||
|
||||
@@ -258,3 +239,4 @@ Returns:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/**@file
|
||||
/** @file
|
||||
Firmware File System driver that produce Firmware Volume protocol.
|
||||
Layers on top of Firmware Block protocol to produce a file abstraction
|
||||
of FV based files.
|
||||
|
||||
Copyright (c) 2006 - 2007 Intel Corporation. <BR>
|
||||
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
|
||||
@@ -53,29 +53,26 @@ FV_DEVICE mFvDevice = {
|
||||
// FFS helper functions
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.
|
||||
@retval EFI_SUCCESS Successfully read volume header to the allocated
|
||||
buffer.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetFwVolHeader (
|
||||
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb,
|
||||
OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
given the supplied FW_VOL_BLOCK_PROTOCOL, allocate a buffer for output and
|
||||
copy the volume header into it.
|
||||
|
||||
Arguments:
|
||||
Fvb - The FW_VOL_BLOCK_PROTOCOL instance from which to read the volume
|
||||
header
|
||||
FwVolHeader - Pointer to pointer to allocated buffer in which the volume
|
||||
header is returned.
|
||||
|
||||
Returns:
|
||||
EFI_OUT_OF_RESOURCES - No enough buffer could be allocated.
|
||||
EFI_SUCCESS - Successfully read volume header to the allocated buffer.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_FIRMWARE_VOLUME_HEADER TempFvh;
|
||||
@@ -119,23 +116,20 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Free FvDevice resource when error happens
|
||||
|
||||
@param FvDevice pointer to the FvDevice to be freed.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
FreeFvDeviceResource (
|
||||
IN FV_DEVICE *FvDevice
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Free FvDevice resource when error happens
|
||||
|
||||
Arguments:
|
||||
FvDevice - pointer to the FvDevice to be freed.
|
||||
|
||||
Returns:
|
||||
None.
|
||||
|
||||
--*/
|
||||
{
|
||||
FFS_FILE_LIST_ENTRY *FfsFileEntry;
|
||||
LIST_ENTRY *NextEntry;
|
||||
@@ -174,24 +168,21 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Check if a FV is consistent and allocate cache
|
||||
|
||||
@param FvDevice pointer to the FvDevice to be checked.
|
||||
|
||||
@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.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
FvCheck (
|
||||
IN OUT FV_DEVICE *FvDevice
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Check if a FV is consistent and allocate cache
|
||||
|
||||
Arguments:
|
||||
FvDevice - pointer to the FvDevice to be checked.
|
||||
|
||||
Returns:
|
||||
EFI_OUT_OF_RESOURCES - No enough buffer could be allocated.
|
||||
EFI_SUCCESS - FV is consistent and cache is allocated.
|
||||
EFI_VOLUME_CORRUPTED - File system is corrupted.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
|
||||
@@ -380,6 +371,17 @@ Done:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
This notification function is invoked when an instance of the
|
||||
EFI_FW_VOLUME_BLOCK_PROTOCOL is produced. It layers an instance of the
|
||||
EFI_FIRMWARE_VOLUME2_PROTOCOL on the same handle. This is the function where
|
||||
the actual initialization of the EFI_FIRMWARE_VOLUME2_PROTOCOL is done.
|
||||
|
||||
@param Event The event that occured
|
||||
@param Context For EFI compatiblity. Not used.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -387,23 +389,6 @@ NotifyFwVolBlock (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This notification function is invoked when an instance of the
|
||||
EFI_FW_VOLUME_BLOCK_PROTOCOL is produced. It layers an instance of the
|
||||
EFI_FIRMWARE_VOLUME2_PROTOCOL on the same handle. This is the function where
|
||||
the actual initialization of the EFI_FIRMWARE_VOLUME2_PROTOCOL is done.
|
||||
|
||||
Arguments:
|
||||
Event - The event that occured
|
||||
Context - For EFI compatiblity. Not used.
|
||||
|
||||
Returns:
|
||||
|
||||
None.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_HANDLE Handle;
|
||||
EFI_STATUS Status;
|
||||
@@ -515,27 +500,24 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
This routine is the driver initialization entry point. It initializes the
|
||||
libraries, and registers two notification functions. These notification
|
||||
functions are responsible for building the FV stack dynamically.
|
||||
|
||||
@param ImageHandle The image handle.
|
||||
@param SystemTable The system table.
|
||||
|
||||
@retval EFI_SUCCESS Function successfully returned.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FwVolDriverInit (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This routine is the driver initialization entry point. It initializes the
|
||||
libraries, and registers two notification functions. These notification
|
||||
functions are responsible for building the FV stack dynamically.
|
||||
|
||||
Arguments:
|
||||
ImageHandle - The image handle.
|
||||
SystemTable - The system table.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Function successfully returned.
|
||||
|
||||
--*/
|
||||
{
|
||||
gEfiFwVolBlockEvent = CoreCreateProtocolNotifyEvent (
|
||||
&gEfiFirmwareVolumeBlockProtocolGuid,
|
||||
@@ -548,3 +530,4 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -15,26 +15,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include <DxeMain.h>
|
||||
|
||||
|
||||
/**
|
||||
Retrieves attributes, insures positive polarity of attribute bits, returns
|
||||
resulting attributes in output parameter.
|
||||
|
||||
@param This Calling context
|
||||
@param Attributes output buffer which contains attributes
|
||||
|
||||
@retval EFI_SUCCESS Successfully got volume attributes
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvGetVolumeAttributes (
|
||||
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
||||
OUT EFI_FV_ATTRIBUTES *Attributes
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves attributes, insures positive polarity of attribute bits, returns
|
||||
resulting attributes in output parameter
|
||||
|
||||
Arguments:
|
||||
This - Calling context
|
||||
Attributes - output buffer which contains attributes
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully got volume attributes
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FV_DEVICE *FvDevice;
|
||||
@@ -67,30 +64,41 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Sets current attributes for volume
|
||||
|
||||
@param This Calling context
|
||||
@param Attributes At input, contains attributes to be set. At output
|
||||
contains new value of FV
|
||||
|
||||
@retval EFI_UNSUPPORTED Could not be set.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvSetVolumeAttributes (
|
||||
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
|
||||
IN OUT EFI_FV_ATTRIBUTES *Attributes
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Sets current attributes for volume
|
||||
|
||||
Arguments:
|
||||
This - Calling context
|
||||
Attributes - At input, contains attributes to be set. At output contains
|
||||
new value of FV
|
||||
|
||||
Returns:
|
||||
EFI_UNSUPPORTED - Could not be set.
|
||||
|
||||
--*/
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvGetVolumeInfo (
|
||||
@@ -99,27 +107,25 @@ FvGetVolumeInfo (
|
||||
IN OUT UINTN *BufferSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Return information of type InformationType for the requested firmware
|
||||
volume.
|
||||
|
||||
Arguments:
|
||||
This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
|
||||
InformationType - InformationType for requested.
|
||||
BufferSize - On input, size of Buffer.On output, the amount of
|
||||
data returned in Buffer.
|
||||
Buffer - A poniter to the data buffer to return.
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully got volume Information.
|
||||
|
||||
--*/
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Set 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 set volume Information.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvSetVolumeInfo (
|
||||
@@ -128,24 +134,9 @@ FvSetVolumeInfo (
|
||||
IN UINTN BufferSize,
|
||||
IN CONST VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Set information of type InformationType for the requested firmware
|
||||
volume.
|
||||
|
||||
Arguments:
|
||||
This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
|
||||
InformationType - InformationType for requested.
|
||||
BufferSize - On input, size of Buffer.On output, the amount of
|
||||
data returned in Buffer.
|
||||
Buffer - A poniter to the data buffer to return.
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully set volume Information.
|
||||
|
||||
--*/
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -36,23 +36,20 @@ Required Alignment Alignment Value in FFS Alignment Value in
|
||||
UINT8 mFvAttributes[] = {0, 4, 7, 9, 10, 12, 15, 16};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Convert the FFS File Attributes to FV File Attributes
|
||||
|
||||
@param FfsAttributes The attributes of UINT8 type.
|
||||
|
||||
@return The attributes of EFI_FV_FILE_ATTRIBUTES
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_FV_FILE_ATTRIBUTES
|
||||
FfsAttributes2FvFileAttributes (
|
||||
IN EFI_FFS_FILE_ATTRIBUTES FfsAttributes
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert the FFS File Attributes to FV File Attributes
|
||||
|
||||
Arguments:
|
||||
FfsAttributes - The attributes of UINT8 type.
|
||||
|
||||
Returns:
|
||||
The attributes of EFI_FV_FILE_ATTRIBUTES
|
||||
|
||||
--*/
|
||||
{
|
||||
FfsAttributes = (EFI_FFS_FILE_ATTRIBUTES)((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT) >> 3);
|
||||
ASSERT (FfsAttributes < 8);
|
||||
@@ -61,6 +58,53 @@ FfsAttributes2FvFileAttributes (
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
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
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvGetNextFile (
|
||||
@@ -69,51 +113,8 @@ FvGetNextFile (
|
||||
IN OUT EFI_FV_FILETYPE *FileType,
|
||||
OUT EFI_GUID *NameGuid,
|
||||
OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
|
||||
OUT UINTN *Size
|
||||
OUT UINTN *Size
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Given the input key, search for the next matching file in the volume.
|
||||
|
||||
Arguments:
|
||||
This - Indicates the calling context.
|
||||
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.
|
||||
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().
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully find the file.
|
||||
EFI_DEVICE_ERROR - Device error.
|
||||
EFI_ACCESS_DENIED - Fv could not read.
|
||||
EFI_NOT_FOUND - No matching file found.
|
||||
EFI_INVALID_PARAMETER - Invalid parameter
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FV_DEVICE *FvDevice;
|
||||
@@ -218,6 +219,47 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvReadFile (
|
||||
@@ -229,44 +271,6 @@ FvReadFile (
|
||||
OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
|
||||
OUT UINT32 *AuthenticationStatus
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Locates a file in the firmware volume and
|
||||
copies it to the supplied buffer.
|
||||
|
||||
Arguments:
|
||||
This - Indicates the calling context.
|
||||
NameGuid - Pointer to an EFI_GUID, which is the filename.
|
||||
Buffer - Buffer is a pointer to pointer to a buffer in
|
||||
which the file or section contents or are returned.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
AuthenticationStatus - AuthenticationStatus is a pointer to a caller
|
||||
allocated UINTN in which the authentication status
|
||||
is returned.
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully read to memory buffer.
|
||||
EFI_WARN_BUFFER_TOO_SMALL - Buffer too small.
|
||||
EFI_NOT_FOUND - Not found.
|
||||
EFI_DEVICE_ERROR - Device error.
|
||||
EFI_ACCESS_DENIED - Could not read.
|
||||
EFI_INVALID_PARAMETER - Invalid parameter.
|
||||
EFI_OUT_OF_RESOURCES - Not enough buffer to be allocated.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FV_DEVICE *FvDevice;
|
||||
@@ -361,6 +365,35 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvReadFileSection (
|
||||
@@ -372,34 +405,6 @@ FvReadFileSection (
|
||||
IN OUT UINTN *BufferSize,
|
||||
OUT UINT32 *AuthenticationStatus
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Locates a section in a given FFS File and
|
||||
copies it to the supplied buffer (not including section header).
|
||||
|
||||
Arguments:
|
||||
This - Indicates the calling context.
|
||||
NameGuid - Pointer to an EFI_GUID, which is the filename.
|
||||
SectionType - Indicates the section type to return.
|
||||
SectionInstance - Indicates which instance of sections with a type of
|
||||
SectionType to return.
|
||||
Buffer - Buffer is a pointer to pointer to a buffer in which
|
||||
the file or section contents or are returned.
|
||||
BufferSize - BufferSize is a pointer to caller allocated UINTN.
|
||||
AuthenticationStatus -AuthenticationStatus is a pointer to a caller
|
||||
allocated UINT32 in which the authentication status
|
||||
is returned.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully read the file section into buffer.
|
||||
EFI_WARN_BUFFER_TOO_SMALL - Buffer too small.
|
||||
EFI_NOT_FOUND - Section not found.
|
||||
EFI_DEVICE_ERROR - Device error.
|
||||
EFI_ACCESS_DENIED - Could not read.
|
||||
EFI_INVALID_PARAMETER - Invalid parameter.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FV_DEVICE *FvDevice;
|
||||
@@ -482,3 +487,4 @@ Done:
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -16,6 +16,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <DxeMain.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FvWriteFile (
|
||||
@@ -24,31 +46,8 @@ FvWriteFile (
|
||||
IN EFI_FV_WRITE_POLICY WritePolicy,
|
||||
IN EFI_FV_WRITE_FILE_DATA *FileData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Writes one or more files to the firmware volume.
|
||||
|
||||
Arguments:
|
||||
This - Indicates the calling context.
|
||||
NumberOfFiles - Number of files.
|
||||
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.
|
||||
FileData - FileData is an pointer to an array of EFI_FV_WRITE_DATA.
|
||||
Each element of FileData[] represents a file to be written.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Files successfully written to firmware volume
|
||||
EFI_OUT_OF_RESOURCES - Not enough buffer to be allocated.
|
||||
EFI_DEVICE_ERROR - Device error.
|
||||
EFI_WRITE_PROTECTED - Write protected.
|
||||
EFI_NOT_FOUND - Not found.
|
||||
EFI_INVALID_PARAMETER - Invalid parameter.
|
||||
EFI_UNSUPPORTED - This function not supported.
|
||||
|
||||
--*/
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user