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