Clean up FaultTolerantWriteDxe for Doxygen comments requirement.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5463 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2008-07-14 08:19:45 +00:00
parent b414ea4b21
commit 6aab82140b
7 changed files with 787 additions and 971 deletions

View File

@@ -16,23 +16,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <FtwLite.h>
/**
Check to see if it is a valid work space.
@param WorkingHeader Pointer of working block header
@retval EFI_SUCCESS The function completed successfully
@retval EFI_ABORTED The function could not complete successfully.
**/
BOOLEAN
IsValidWorkSpace (
IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader
)
/*++
Routine Description:
Check to see if it is a valid work space.
Arguments:
WorkingHeader - Pointer of working block header
Returns:
EFI_SUCCESS - The function completed successfully
EFI_ABORTED - The function could not complete successfully.
--*/
{
EFI_STATUS Status;
EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER WorkingBlockHeader;
@@ -85,23 +82,20 @@ Returns:
return TRUE;
}
/**
Initialize a work space when there is no work space.
@param WorkingHeader Pointer of working block header
@retval EFI_SUCCESS The function completed successfully
@retval EFI_ABORTED The function could not complete successfully.
**/
EFI_STATUS
InitWorkSpaceHeader (
IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader
)
/*++
Routine Description:
Initialize a work space when there is no work space.
Arguments:
WorkingHeader - Pointer of working block header
Returns:
EFI_SUCCESS - The function completed successfully
EFI_ABORTED - The function could not complete successfully.
--*/
{
EFI_STATUS Status;
@@ -143,6 +137,24 @@ Returns:
return EFI_SUCCESS;
}
/**
Update a bit of state on a block device. The location of the bit is
calculated by the (Lba, Offset, bit). Here bit is determined by the
the name of a certain bit.
@param FvBlock FVB Protocol interface to access SrcBlock and DestBlock
@param Lba Lba of a block
@param Offset Offset on the Lba
@param NewBit New value that will override the old value if it can be change
@retval EFI_SUCCESS A state bit has been updated successfully
@retval Others Access block device error.
Notes:
Assume all bits of State are inside the same BYTE.
@retval EFI_ABORTED Read block fail
**/
EFI_STATUS
FtwUpdateFvState (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,
@@ -150,28 +162,6 @@ FtwUpdateFvState (
IN UINTN Offset,
IN UINT8 NewBit
)
/*++
Routine Description:
Update a bit of state on a block device. The location of the bit is
calculated by the (Lba, Offset, bit). Here bit is determined by the
the name of a certain bit.
Arguments:
FvBlock - FVB Protocol interface to access SrcBlock and DestBlock
Lba - Lba of a block
Offset - Offset on the Lba
NewBit - New value that will override the old value if it can be change
Returns:
EFI_SUCCESS - A state bit has been updated successfully
Others - Access block device error.
Notes:
Assume all bits of State are inside the same BYTE.
EFI_ABORTED - Read block fail
--*/
{
EFI_STATUS Status;
UINT8 State;
@@ -199,27 +189,24 @@ Notes:
return Status;
}
/**
Get the last Write record pointer.
The last record is the record whose 'complete' state hasn't been set.
After all, this header may be a EMPTY header entry for next Allocate.
@param FtwLiteDevice Private data of this driver
@param FtwLastRecord Pointer to retrieve the last write record
@retval EFI_SUCCESS Get the last write record successfully
@retval EFI_ABORTED The FTW work space is damaged
**/
EFI_STATUS
FtwGetLastRecord (
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,
OUT EFI_FTW_LITE_RECORD **FtwLastRecord
)
/*++
Routine Description:
Get the last Write record pointer.
The last record is the record whose 'complete' state hasn't been set.
After all, this header may be a EMPTY header entry for next Allocate.
Arguments:
FtwLiteDevice - Private data of this driver
FtwLastRecord - Pointer to retrieve the last write record
Returns:
EFI_SUCCESS - Get the last write record successfully
EFI_ABORTED - The FTW work space is damaged
--*/
{
EFI_FTW_LITE_RECORD *Record;
@@ -241,23 +228,20 @@ Returns:
return EFI_SUCCESS;
}
/**
Read from working block to refresh the work space in memory.
@param FtwLiteDevice Point to private data of FTW driver
@retval EFI_SUCCESS The function completed successfully
@retval EFI_ABORTED The function could not complete successfully.
**/
EFI_STATUS
WorkSpaceRefresh (
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice
)
/*++
Routine Description:
Read from working block to refresh the work space in memory.
Arguments:
FtwLiteDevice - Point to private data of FTW driver
Returns:
EFI_SUCCESS - The function completed successfully
EFI_ABORTED - The function could not complete successfully.
--*/
{
EFI_STATUS Status;
UINTN Length;
@@ -313,29 +297,26 @@ Returns:
return EFI_SUCCESS;
}
/**
Reclaim the work space. Get rid of all the completed write records
and write records in the Fault Tolerant work space.
@param FtwLiteDevice Point to private data of FTW driver
@param FtwSpaceBuffer Buffer to contain the reclaimed clean data
@param BufferSize Size of the FtwSpaceBuffer
@retval EFI_SUCCESS The function completed successfully
@retval EFI_BUFFER_TOO_SMALL The FtwSpaceBuffer is too small
@retval EFI_ABORTED The function could not complete successfully.
**/
EFI_STATUS
CleanupWorkSpace (
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,
IN OUT UINT8 *FtwSpaceBuffer,
IN UINTN BufferSize
)
/*++
Routine Description:
Reclaim the work space. Get rid of all the completed write records
and write records in the Fault Tolerant work space.
Arguments:
FtwLiteDevice - Point to private data of FTW driver
FtwSpaceBuffer - Buffer to contain the reclaimed clean data
BufferSize - Size of the FtwSpaceBuffer
Returns:
EFI_SUCCESS - The function completed successfully
EFI_BUFFER_TOO_SMALL - The FtwSpaceBuffer is too small
EFI_ABORTED - The function could not complete successfully.
--*/
{
UINTN Length;
EFI_FTW_LITE_RECORD *Record;
@@ -376,24 +357,21 @@ Returns:
return EFI_SUCCESS;
}
/**
Reclaim the work space on the working block.
@param FtwLiteDevice Point to private data of FTW driver
@retval EFI_SUCCESS The function completed successfully
@retval EFI_OUT_OF_RESOURCES Allocate memory error
@retval EFI_ABORTED The function could not complete successfully
**/
EFI_STATUS
FtwReclaimWorkSpace (
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice
)
/*++
Routine Description:
Reclaim the work space on the working block.
Arguments:
FtwLiteDevice - Point to private data of FTW driver
Returns:
EFI_SUCCESS - The function completed successfully
EFI_OUT_OF_RESOURCES - Allocate memory error
EFI_ABORTED - The function could not complete successfully
--*/
{
EFI_STATUS Status;
UINT8 *TempBuffer;