//\r
// Fault Tolerant Write Protocol API\r
//\r
+/**\r
+ Starts a target block update. This function will record data about write\r
+ in fault tolerant storage and will complete the write in a recoverable\r
+ manner, ensuring at all times that either the original contents or\r
+ the modified contents are available.\r
+\r
+\r
+ @param This Calling context\r
+ @param FvbHandle The handle of FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
+ @param Lba The logical block address of the target block.\r
+ @param Offset The offset within the target block to place the data.\r
+ @param NumBytes The number of bytes to write to the target block.\r
+ @param Buffer The data to write.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_BAD_BUFFER_SIZE The write would span a target block, which is not\r
+ a valid action.\r
+ @retval EFI_ACCESS_DENIED No writes have been allocated.\r
+ @retval EFI_NOT_FOUND Cannot find FVB by handle.\r
+ @retval EFI_OUT_OF_RESOURCES Cannot allocate memory.\r
+ @retval EFI_ABORTED The function could not complete successfully.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
FtwLiteWrite (\r
IN OUT UINTN *NumBytes,\r
IN VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Starts a target block update. This function will record data about write \r
- in fault tolerant storage and will complete the write in a recoverable \r
- manner, ensuring at all times that either the original contents or \r
- the modified contents are available.\r
-\r
-Arguments:\r
- This - Calling context\r
- FvbHandle - The handle of FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
- Lba - The logical block address of the target block. \r
- Offset - The offset within the target block to place the data.\r
- NumBytes - The number of bytes to write to the target block.\r
- Buffer - The data to write.\r
-\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_BAD_BUFFER_SIZE - The write would span a target block, which is not \r
- a valid action.\r
- EFI_ACCESS_DENIED - No writes have been allocated.\r
- EFI_NOT_FOUND - Cannot find FVB by handle.\r
- EFI_OUT_OF_RESOURCES - Cannot allocate memory.\r
- EFI_ABORTED - The function could not complete successfully.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice;\r
}\r
\r
\r
+/**\r
+ Write a record with fault tolerant mannaer.\r
+ Since the content has already backuped in spare block, the write is\r
+ guaranteed to be completed with fault tolerant manner.\r
+\r
+\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+ @param Fvb The FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+\r
+**/\r
EFI_STATUS\r
FtwWriteRecord (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Write a record with fault tolerant mannaer.\r
- Since the content has already backuped in spare block, the write is \r
- guaranteed to be completed with fault tolerant manner.\r
- \r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
- Fvb - The FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
-\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ABORTED - The function could not complete successfully\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_FTW_LITE_RECORD *Record;\r
}\r
\r
\r
+/**\r
+ Restarts a previously interrupted write. The caller must provide the\r
+ block protocol needed to complete the interrupted write.\r
+\r
+\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+ FvbHandle - The handle of FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ACCESS_DENIED No pending writes exist\r
+ @retval EFI_NOT_FOUND FVB protocol not found by the handle\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+\r
+**/\r
EFI_STATUS\r
FtwRestart (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Restarts a previously interrupted write. The caller must provide the \r
- block protocol needed to complete the interrupted write.\r
- \r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
- FvbHandle - The handle of FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
-\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ACCESS_DENIED - No pending writes exist\r
- EFI_NOT_FOUND - FVB protocol not found by the handle\r
- EFI_ABORTED - The function could not complete successfully\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_FTW_LITE_RECORD *Record;\r
}\r
\r
\r
-EFI_STATUS\r
-FtwAbort (\r
- IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
- )\r
-/*++\r
+/**\r
+ Aborts all previous allocated writes.\r
\r
-Routine Description:\r
- Aborts all previous allocated writes.\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ABORTED - The function could not complete successfully.\r
- EFI_NOT_FOUND - No allocated writes exist.\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully.\r
+ @retval EFI_NOT_FOUND No allocated writes exist.\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+FtwAbort (\r
+ IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
+ )\r
{\r
EFI_STATUS Status;\r
UINTN Offset;\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ This function is the entry point of the Fault Tolerant Write driver.\r
+\r
+\r
+ @param ImageHandle EFI_HANDLE: A handle for the image that is initializing\r
+ this driver\r
+ @param SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table\r
+\r
+ @retval EFI_SUCCESS FTW has finished the initialization\r
+ @retval EFI_ABORTED FTW initialization error\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
InitializeFtwLite (\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-/*++\r
- Routine Description: \r
- This function is the entry point of the Fault Tolerant Write driver.\r
- \r
- Arguments: \r
- ImageHandle - EFI_HANDLE: A handle for the image that is initializing \r
- this driver\r
- SystemTable - EFI_SYSTEM_TABLE: A pointer to the EFI system table\r
- \r
- Returns: \r
- EFI_SUCCESS - FTW has finished the initialization\r
- EFI_ABORTED - FTW initialization error\r
-\r
---*/\r
{\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;\r
UINTN Index;\r
//\r
// Driver entry point\r
//\r
+/**\r
+ This function is the entry point of the Fault Tolerant Write driver.\r
+\r
+\r
+ @param ImageHandle EFI_HANDLE: A handle for the image that is initializing\r
+ this driver\r
+ @param SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table\r
+\r
+ @retval EFI_SUCCESS FTW has finished the initialization\r
+ @retval EFI_ABORTED FTW initialization error\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
InitializeFtwLite (\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-/*++\r
-\r
-Routine Description:\r
- This function is the entry point of the Fault Tolerant Write driver.\r
-\r
-Arguments:\r
- ImageHandle - EFI_HANDLE: A handle for the image that is initializing \r
- this driver\r
- SystemTable - EFI_SYSTEM_TABLE: A pointer to the EFI system table\r
-\r
-Returns:\r
- EFI_SUCCESS - FTW has finished the initialization\r
- EFI_ABORTED - FTW initialization error\r
-\r
---*/\r
;\r
\r
//\r
// Fault Tolerant Write Protocol API\r
//\r
+/**\r
+ Starts a target block update. This function will record data about write\r
+ in fault tolerant storage and will complete the write in a recoverable\r
+ manner, ensuring at all times that either the original contents or\r
+ the modified contents are available.\r
+\r
+\r
+ @param This Calling context\r
+ @param FvbHandle The handle of FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
+ @param Lba The logical block address of the target block.\r
+ @param Offset The offset within the target block to place the data.\r
+ @param NumBytes The number of bytes to write to the target block.\r
+ @param Buffer The data to write.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_BAD_BUFFER_SIZE The write would span a target block, which is not\r
+ a valid action.\r
+ @retval EFI_ACCESS_DENIED No writes have been allocated.\r
+ @retval EFI_NOT_FOUND Cannot find FVB by handle.\r
+ @retval EFI_OUT_OF_RESOURCES Cannot allocate memory.\r
+ @retval EFI_ABORTED The function could not complete successfully.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
FtwLiteWrite (\r
- IN EFI_FTW_LITE_PROTOCOL *This,\r
- IN EFI_HANDLE FvbHandle,\r
- IN EFI_LBA Lba,\r
- IN UINTN Offset,\r
- IN UINTN *NumBytes,\r
- IN VOID *Buffer\r
+ IN EFI_FTW_LITE_PROTOCOL *This,\r
+ IN EFI_HANDLE FvbHandle,\r
+ IN EFI_LBA Lba,\r
+ IN UINTN Offset,\r
+ IN OUT UINTN *NumBytes,\r
+ IN VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Starts a target block update. This function will record data about write \r
- in fault tolerant storage and will complete the write in a recoverable \r
- manner, ensuring at all times that either the original contents or \r
- the modified contents are available.\r
-\r
-Arguments:\r
- This - Calling context\r
- FvbHandle - The handle of FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
- Lba - The logical block address of the target block. \r
- Offset - The offset within the target block to place the data.\r
- NumBytes - The number of bytes to write to the target block.\r
- Buffer - The data to write.\r
-\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_BAD_BUFFER_SIZE - The write would span a target block, which is not \r
- a valid action.\r
- EFI_ACCESS_DENIED - No writes have been allocated.\r
- EFI_NOT_FOUND - Cannot find FVB by handle.\r
- EFI_OUT_OF_RESOURCES - Cannot allocate memory.\r
- EFI_ABORTED - The function could not complete successfully.\r
-\r
---*/\r
;\r
\r
//\r
// Internal functions\r
//\r
+/**\r
+ Restarts a previously interrupted write. The caller must provide the\r
+ block protocol needed to complete the interrupted write.\r
+\r
+\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+ FvbHandle - The handle of FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ACCESS_DENIED No pending writes exist\r
+ @retval EFI_NOT_FOUND FVB protocol not found by the handle\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+\r
+**/\r
EFI_STATUS\r
FtwRestart (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- Restarts a previously interrupted write. The caller must provide the \r
- block protocol needed to complete the interrupted write.\r
+/**\r
+ Aborts all previous allocated writes.\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
- FvbHandle - The handle of FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ACCESS_DENIED - No pending writes exist\r
- EFI_NOT_FOUND - FVB protocol not found by the handle\r
- EFI_ABORTED - The function could not complete successfully\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully.\r
+ @retval EFI_NOT_FOUND No allocated writes exist.\r
\r
+**/\r
EFI_STATUS\r
FtwAbort (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- Aborts all previous allocated writes.\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
+/**\r
+ Write a record with fault tolerant mannaer.\r
+ Since the content has already backuped in spare block, the write is\r
+ guaranteed to be completed with fault tolerant manner.\r
\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ABORTED - The function could not complete successfully.\r
- EFI_NOT_FOUND - No allocated writes exist.\r
\r
---*/\r
-;\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+ @param Fvb The FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully\r
\r
+**/\r
EFI_STATUS\r
FtwWriteRecord (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- Write a record with fault tolerant mannaer.\r
- Since the content has already backuped in spare block, the write is \r
- guaranteed to be completed with fault tolerant manner.\r
+/**\r
+ To Erase one block. The size is FTW_BLOCK_SIZE\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
- Fvb - The FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ABORTED - The function could not complete successfully\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock FVB Protocol interface\r
+ @param Lba Lba of the firmware block\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Block LBA is Erased successfully\r
+ @retval Others Error occurs\r
\r
+**/\r
EFI_STATUS\r
FtwEraseBlock (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- To Erase one block. The size is FTW_BLOCK_SIZE\r
+/**\r
\r
-Arguments:\r
- FtwLiteDevice - Calling context\r
- FvBlock - FVB Protocol interface\r
- Lba - Lba of the firmware block\r
+ Erase spare block.\r
\r
-Returns:\r
- EFI_SUCCESS - Block LBA is Erased successfully\r
- Others - Error occurs\r
\r
---*/\r
-;\r
+ @param FtwLiteDevice Calling context\r
\r
+ @retval EFI_SUCCESS The erase request was successfully\r
+ completed.\r
+ \r
+ @retval EFI_ACCESS_DENIED The firmware volume is in the\r
+ WriteDisabled state.\r
+ @retval EFI_DEVICE_ERROR The block device is not functioning\r
+ correctly and could not be written.\r
+ The firmware device may have been\r
+ partially erased.\r
+ @retval EFI_INVALID_PARAMETER One or more of the LBAs listed\r
+ in the variable argument list do\r
+ not exist in the firmware volume. \r
+\r
+**/\r
EFI_STATUS\r
FtwEraseSpareBlock (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Erase spare block.\r
-\r
-Arguments:\r
+;\r
\r
- FtwLiteDevice - Calling context\r
+/**\r
+ Retrive the proper FVB protocol interface by HANDLE.\r
\r
-Returns:\r
\r
- Status code\r
+ @param FvBlockHandle The handle of FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
+ @param FvBlock The interface of FVB protocol\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully\r
\r
+**/\r
EFI_STATUS\r
FtwGetFvbByHandle (\r
IN EFI_HANDLE FvBlockHandle,\r
OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- Retrive the proper FVB protocol interface by HANDLE.\r
+/**\r
\r
-Arguments:\r
- FvBlockHandle - The handle of FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
- FvBlock - The interface of FVB protocol\r
+ Get firmware block by address.\r
\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ABORTED - The function could not complete successfully\r
---*/\r
-;\r
\r
+ @param Address Address specified the block\r
+ @param FvBlock The block caller wanted\r
+\r
+ @retval EFI_SUCCESS The protocol instance if found.\r
+ @retval EFI_NOT_FOUND Block not found\r
+\r
+**/\r
EFI_STATUS\r
GetFvbByAddress (\r
IN EFI_PHYSICAL_ADDRESS Address,\r
OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get firmware block by address.\r
+;\r
\r
-Arguments:\r
+/**\r
\r
- Address - Address specified the block\r
- FvBlock - The block caller wanted\r
+ Is it in working block?\r
\r
-Returns:\r
\r
- Status code\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock Fvb protocol instance\r
+ @param Lba The block specified\r
\r
- EFI_NOT_FOUND - Block not found\r
-\r
---*/\r
-;\r
+ @return A BOOLEAN value indicating in working block or not.\r
\r
+**/\r
BOOLEAN\r
IsInWorkingBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Is it in working block?\r
+;\r
\r
-Arguments:\r
+/**\r
\r
- FtwLiteDevice - Calling context\r
- FvBlock - Fvb protocol instance\r
- Lba - The block specified\r
+ Check whether the block is a boot block.\r
\r
-Returns:\r
\r
- In working block or not\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock Fvb protocol instance\r
+ @param Lba Lba value\r
\r
---*/\r
-;\r
+ @retval FALSE This is a boot block.\r
+ @retval TRUE This is not a boot block.\r
\r
+**/\r
BOOLEAN\r
IsBootBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check whether the block is a boot block.\r
-\r
-Arguments:\r
+;\r
\r
- FtwLiteDevice - Calling context\r
- FvBlock - Fvb protocol instance\r
- Lba - Lba value\r
+/**\r
+ Copy the content of spare block to a target block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Target block is accessed by FvBlock protocol interface. LBA is Lba.\r
\r
-Returns:\r
\r
- Is a boot block or not\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+ @param FvBlock FVB Protocol interface to access target block\r
+ @param Lba Lba of the target block\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Spare block content is copied to target block\r
+ @retval EFI_INVALID_PARAMETER Input parameter error\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
\r
+**/\r
EFI_STATUS\r
FlushSpareBlockToTargetBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to a target block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Target block is accessed by FvBlock protocol interface. LBA is Lba.\r
-\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
- FvBlock - FVB Protocol interface to access target block\r
- Lba - Lba of the target block\r
-\r
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to target block\r
- EFI_INVALID_PARAMETER - Input parameter error\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
-\r
---*/\r
;\r
\r
+/**\r
+ Copy the content of spare block to working block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Working block is accessed by FTW working FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwWorkBlockLba.\r
+\r
+\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+\r
+ @retval EFI_SUCCESS Spare block content is copied to target block\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+ Notes:\r
+ Since the working block header is important when FTW initializes, the\r
+ state of the operation should be handled carefully. The Crc value is\r
+ calculated without STATE element.\r
+\r
+**/\r
EFI_STATUS\r
FlushSpareBlockToWorkingBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to working block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Working block is accessed by FTW working FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwWorkBlockLba.\r
+;\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
+/**\r
+ Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
\r
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to target block\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
\r
-Notes:\r
- Since the working block header is important when FTW initializes, the \r
- state of the operation should be handled carefully. The Crc value is \r
- calculated without STATE element. \r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Spare block content is copied to boot block\r
+ @retval EFI_INVALID_PARAMETER Input parameter error\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+ Notes:\r
\r
+**/\r
EFI_STATUS\r
FlushSpareBlockToBootBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
+;\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\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
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to boot block\r
- EFI_INVALID_PARAMETER - Input parameter error\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
\r
-Notes:\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
---*/\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
\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
+ 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
- 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
+ @param FtwLiteDevice Private data of this driver\r
+ @param FtwLastRecord Pointer to retrieve the last write record\r
\r
-Notes:\r
- Assume all bits of State are inside the same BYTE. \r
-\r
- EFI_ABORTED - Read block fail\r
---*/\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
\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
\r
-Arguments:\r
- FtwLiteDevice - Private data of this driver\r
- FtwLastRecord - Pointer to retrieve the last write record\r
+ Check whether a flash buffer is erased.\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
+ @param Polarity All 1 or all 0\r
+ @param Buffer Buffer to check\r
+ @param BufferSize Size of the buffer\r
\r
+ @return A BOOLEAN value indicating erased or not.\r
+\r
+**/\r
BOOLEAN\r
IsErasedFlashBuffer (\r
IN BOOLEAN Polarity,\r
IN UINT8 *Buffer,\r
IN UINTN BufferSize\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check whether a flash buffer is erased.\r
-\r
-Arguments:\r
+;\r
\r
- Polarity - All 1 or all 0\r
- Buffer - Buffer to check\r
- BufferSize - Size of the buffer\r
+/**\r
+ Initialize a work space when there is no work space.\r
\r
-Returns:\r
\r
- Erased or not.\r
+ @param WorkingHeader Pointer of working block header\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully.\r
\r
+**/\r
EFI_STATUS\r
InitWorkSpaceHeader (\r
IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- Initialize a work space when there is no work space.\r
+/**\r
+ Read from working block to refresh the work space in memory.\r
\r
-Arguments:\r
- 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
+ @param FtwLiteDevice Point to private data of FTW driver\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully.\r
\r
+**/\r
EFI_STATUS\r
WorkSpaceRefresh (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- Read from working block to refresh the work space in memory.\r
+/**\r
+ Check to see if it is a valid work space.\r
\r
-Arguments:\r
- 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
+ @param WorkingHeader Pointer of working block header\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully.\r
\r
+**/\r
BOOLEAN\r
IsValidWorkSpace (\r
IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r
)\r
-/*++\r
+;\r
\r
-Routine Description:\r
- Check to see if it is a valid work space.\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
-Arguments:\r
- 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
+ @param FtwLiteDevice Point to private data of FTW driver\r
+ FtwSpaceBuffer - Buffer to contain the reclaimed clean data\r
+ @param BlockBuffer The data buffer for the block.\r
+ @param BufferSize Size of the FtwSpaceBuffer\r
\r
---*/\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 *BlockBuffer,\r
IN UINTN BufferSize\r
)\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
+ Reclaim the work space on the working block.\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
+ @param FtwLiteDevice Point to private data of FTW driver\r
\r
---*/\r
-;\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
EFI_STATUS\r
FtwReclaimWorkSpace (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\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
-\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
-\r
---*/\r
;\r
\r
#endif\r
\r
#include <FtwLite.h>\r
\r
-BOOLEAN\r
-IsErasedFlashBuffer (\r
- IN BOOLEAN Polarity,\r
- IN UINT8 *Buffer,\r
- IN UINTN BufferSize\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Check whether a flash buffer is erased.\r
\r
-Arguments:\r
-\r
- Polarity - All 1 or all 0\r
- Buffer - Buffer to check\r
- BufferSize - Size of the buffer\r
\r
-Returns:\r
+ @param Polarity All 1 or all 0\r
+ @param Buffer Buffer to check\r
+ @param BufferSize Size of the buffer\r
\r
- Erased or not.\r
+ @return A BOOLEAN value indicating erased or not.\r
\r
---*/\r
+**/\r
+BOOLEAN\r
+IsErasedFlashBuffer (\r
+ IN BOOLEAN Polarity,\r
+ IN UINT8 *Buffer,\r
+ IN UINTN BufferSize\r
+ )\r
{\r
UINT8 ErasedValue;\r
UINT8 *Ptr;\r
}\r
\r
Ptr = Buffer;\r
- while (BufferSize--) {\r
+ while ((BufferSize--) != 0) {\r
if (*Ptr++ != ErasedValue) {\r
return FALSE;\r
}\r
return TRUE;\r
}\r
\r
+/**\r
+ To Erase one block. The size is FTW_BLOCK_SIZE\r
+\r
+\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock FVB Protocol interface\r
+ @param Lba Lba of the firmware block\r
+\r
+ @retval EFI_SUCCESS Block LBA is Erased successfully\r
+ @retval Others Error occurs\r
+\r
+**/\r
EFI_STATUS\r
FtwEraseBlock (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
-\r
-Routine Description:\r
- To Erase one block. The size is FTW_BLOCK_SIZE\r
-\r
-Arguments:\r
- FtwLiteDevice - Calling context\r
- FvBlock - FVB Protocol interface\r
- Lba - Lba of the firmware block\r
-\r
-Returns:\r
- EFI_SUCCESS - Block LBA is Erased successfully\r
- Others - Error occurs\r
-\r
---*/\r
{\r
return FvBlock->EraseBlocks (\r
FvBlock,\r
);\r
}\r
\r
-EFI_STATUS\r
-FtwEraseSpareBlock (\r
- IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Erase spare block.\r
\r
-Arguments:\r
\r
- FtwLiteDevice - Calling context\r
+ @param FtwLiteDevice Calling context\r
\r
-Returns:\r
+ @retval EFI_SUCCESS The erase request was successfully\r
+ completed.\r
+ \r
+ @retval EFI_ACCESS_DENIED The firmware volume is in the\r
+ WriteDisabled state.\r
+ @retval EFI_DEVICE_ERROR The block device is not functioning\r
+ correctly and could not be written.\r
+ The firmware device may have been\r
+ partially erased.\r
+ @retval EFI_INVALID_PARAMETER One or more of the LBAs listed\r
+ in the variable argument list do\r
+ not exist in the firmware volume. \r
\r
- Status code\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+FtwEraseSpareBlock (\r
+ IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
+ )\r
{\r
return FtwLiteDevice->FtwBackupFvb->EraseBlocks (\r
FtwLiteDevice->FtwBackupFvb,\r
);\r
}\r
\r
+/**\r
+ Retrive the proper FVB protocol interface by HANDLE.\r
+\r
+\r
+ @param FvBlockHandle The handle of FVB protocol that provides services for\r
+ reading, writing, and erasing the target block.\r
+ @param FvBlock The interface of FVB protocol\r
+\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+\r
+**/\r
EFI_STATUS\r
FtwGetFvbByHandle (\r
IN EFI_HANDLE FvBlockHandle,\r
OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Retrive the proper FVB protocol interface by HANDLE.\r
-\r
-Arguments:\r
- FvBlockHandle - The handle of FVB protocol that provides services for \r
- reading, writing, and erasing the target block.\r
- FvBlock - The interface of FVB protocol\r
-\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
- EFI_ABORTED - The function could not complete successfully\r
---*/\r
{\r
//\r
// To get the FVB protocol interface on the handle\r
);\r
}\r
\r
-EFI_STATUS\r
-GetFvbByAddress (\r
- IN EFI_PHYSICAL_ADDRESS Address,\r
- OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Get firmware block by address.\r
\r
-Arguments:\r
-\r
- Address - Address specified the block\r
- FvBlock - The block caller wanted\r
\r
-Returns:\r
+ @param Address Address specified the block\r
+ @param FvBlock The block caller wanted\r
\r
- Status code\r
+ @retval EFI_SUCCESS The protocol instance if found.\r
+ @retval EFI_NOT_FOUND Block not found\r
\r
- EFI_NOT_FOUND - Block not found\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+GetFvbByAddress (\r
+ IN EFI_PHYSICAL_ADDRESS Address,\r
+ OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_HANDLE *HandleBuffer;\r
return Status;\r
}\r
\r
-BOOLEAN\r
-IsInWorkingBlock (\r
- EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
- EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
- EFI_LBA Lba\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Is it in working block?\r
\r
-Arguments:\r
\r
- FtwLiteDevice - Calling context\r
- FvBlock - Fvb protocol instance\r
- Lba - The block specified\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock Fvb protocol instance\r
+ @param Lba The block specified\r
\r
-Returns:\r
+ @return A BOOLEAN value indicating in working block or not.\r
\r
- In working block or not\r
-\r
---*/\r
+**/\r
+BOOLEAN\r
+IsInWorkingBlock (\r
+ EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
+ EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
+ EFI_LBA Lba\r
+ )\r
{\r
//\r
// If matching the following condition, the target block is in working block.\r
);\r
}\r
\r
+/**\r
+ Copy the content of spare block to a target block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Target block is accessed by FvBlock protocol interface. LBA is Lba.\r
+\r
+\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+ @param FvBlock FVB Protocol interface to access target block\r
+ @param Lba Lba of the target block\r
+\r
+ @retval EFI_SUCCESS Spare block content is copied to target block\r
+ @retval EFI_INVALID_PARAMETER Input parameter error\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+\r
+**/\r
EFI_STATUS\r
FlushSpareBlockToTargetBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to a target block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Target block is accessed by FvBlock protocol interface. LBA is Lba.\r
-\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
- FvBlock - FVB Protocol interface to access target block\r
- Lba - Lba of the target block\r
-\r
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to target block\r
- EFI_INVALID_PARAMETER - Input parameter error\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
UINTN Length;\r
return Status;\r
}\r
\r
-EFI_STATUS\r
-FlushSpareBlockToWorkingBlock (\r
- EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to working block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Working block is accessed by FTW working FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwWorkBlockLba.\r
+/**\r
+ Copy the content of spare block to working block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Working block is accessed by FTW working FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwWorkBlockLba.\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
\r
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to target block\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
\r
-Notes:\r
- Since the working block header is important when FTW initializes, the \r
- state of the operation should be handled carefully. The Crc value is \r
- calculated without STATE element. \r
+ @retval EFI_SUCCESS Spare block content is copied to target block\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+ Notes:\r
+ Since the working block header is important when FTW initializes, the\r
+ state of the operation should be handled carefully. The Crc value is\r
+ calculated without STATE element.\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+FlushSpareBlockToWorkingBlock (\r
+ EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
+ )\r
{\r
EFI_STATUS Status;\r
UINTN Length;\r
\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
#define GEN_STATUS 0xD4\r
#define TOP_SWAP_BIT (1 << 13)\r
\r
-STATIC\r
-UINT32\r
-ReadPciRegister (\r
- IN UINT32 Offset\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Read PCI register value.\r
+ This is a internal function.\r
\r
-Arguments:\r
-\r
- Offset - Offset of the register\r
\r
-Returns:\r
+ @param Offset Offset of the register\r
\r
- The value.\r
+ @return The pci register value.\r
\r
---*/\r
+**/\r
+UINT32\r
+ReadPciRegister (\r
+ IN UINT32 Offset\r
+ )\r
{\r
EFI_STATUS Status;\r
UINT32 Value;\r
return Value;\r
}\r
\r
-STATIC\r
-EFI_STATUS\r
-GetSwapState (\r
- IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
- OUT BOOLEAN *SwapState\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Get swap state\r
\r
-Arguments:\r
+ This is a internal function.\r
\r
- FtwLiteDevice - Calling context\r
- SwapState - Swap state\r
+ @param FtwLiteDevice Calling context\r
+ @param SwapState Swap state\r
\r
-Returns:\r
+ @retval EFI_SUCCESS State successfully got\r
\r
- EFI_SUCCESS - State successfully got\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+GetSwapState (\r
+ IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
+ OUT BOOLEAN *SwapState\r
+ )\r
{\r
//\r
// Top swap status is 13 bit\r
return EFI_SUCCESS;\r
}\r
\r
-STATIC\r
+/**\r
+ Set swap state.\r
+\r
+ This is a internal function.\r
+\r
+ @param FtwLiteDevice Indicates a pointer to the calling context.\r
+ @param TopSwap New swap state\r
+\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ Note:\r
+ the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that\r
+ software will not be able to clear the Top-Swap bit until the system is\r
+ rebooted without GNT[A]# being pulled down.\r
+\r
+**/\r
EFI_STATUS\r
SetSwapState (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
IN BOOLEAN TopSwap\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Set swap state.\r
-\r
-Arguments:\r
- FtwLiteDevice - Indicates a pointer to the calling context. \r
- TopSwap - New swap state\r
-\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
-\r
-Note:\r
- the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that\r
- software will not be able to clear the Top-Swap bit until the system is\r
- rebooted without GNT[A]# being pulled down.\r
-\r
---*/\r
{\r
UINT32 GenStatus;\r
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;\r
return EFI_SUCCESS;\r
}\r
\r
-BOOLEAN\r
-IsBootBlock (\r
- EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
- EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
- EFI_LBA Lba\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Check whether the block is a boot block.\r
\r
-Arguments:\r
-\r
- FtwLiteDevice - Calling context\r
- FvBlock - Fvb protocol instance\r
- Lba - Lba value\r
\r
-Returns:\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock Fvb protocol instance\r
+ @param Lba Lba value\r
\r
- Is a boot block or not\r
+ @retval FALSE This is a boot block.\r
+ @retval TRUE This is not a boot block.\r
\r
---*/\r
+**/\r
+BOOLEAN\r
+IsBootBlock (\r
+ EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
+ EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
+ EFI_LBA Lba\r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *BootFvb;\r
return (BOOLEAN) (FvBlock == BootFvb);\r
}\r
\r
+/**\r
+ Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
+\r
+\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
+\r
+ @retval EFI_SUCCESS Spare block content is copied to boot block\r
+ @retval EFI_INVALID_PARAMETER Input parameter error\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+ Notes:\r
+ FTW will do extra work on boot block update.\r
+ FTW should depend on a protocol of EFI_ADDRESS_RANGE_SWAP_PROTOCOL,\r
+ which is produced by a chipset driver.\r
+ FTW updating boot block steps:\r
+ 1. Erase top swap block (0xFFFE-0xFFFEFFFF) and write data to it ready\r
+ 2. Read data from top swap block to memory buffer\r
+ 3. SetSwapState(EFI_SWAPPED)\r
+ 4. Erasing boot block (0xFFFF-0xFFFFFFFF)\r
+ 5. Programming boot block until the boot block is ok.\r
+ 6. SetSwapState(UNSWAPPED)\r
+ Notes:\r
+ 1. Since the SwapState bit is saved in CMOS, FTW can restore and continue\r
+ even in the scenario of power failure.\r
+ 2. FTW shall not allow to update boot block when battery state is error.\r
+\r
+**/\r
EFI_STATUS\r
FlushSpareBlockToBootBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
-\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
-\r
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to boot block\r
- EFI_INVALID_PARAMETER - Input parameter error\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
-\r
-Notes:\r
- FTW will do extra work on boot block update.\r
- FTW should depend on a protocol of EFI_ADDRESS_RANGE_SWAP_PROTOCOL, \r
- which is produced by a chipset driver.\r
-\r
- FTW updating boot block steps:\r
- 1. Erase top swap block (0xFFFE-0xFFFEFFFF) and write data to it ready\r
- 2. Read data from top swap block to memory buffer\r
- 3. SetSwapState(EFI_SWAPPED)\r
- 4. Erasing boot block (0xFFFF-0xFFFFFFFF)\r
- 5. Programming boot block until the boot block is ok.\r
- 6. SetSwapState(UNSWAPPED)\r
-\r
- Notes:\r
- 1. Since the SwapState bit is saved in CMOS, FTW can restore and continue \r
- even in the scenario of power failure.\r
- 2. FTW shall not allow to update boot block when battery state is error.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
UINTN Length;\r
//\r
#define BOOT_BLOCK_BASE\r
\r
-STATIC\r
+/**\r
+\r
+ Get swap state\r
+ This is a internal function.\r
+\r
+ @param FtwLiteDevice Calling context\r
+ @param SwapState Swap state\r
+\r
+ @retval EFI_SUCCESS State successfully got\r
+\r
+**/\r
EFI_STATUS\r
GetSwapState (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
OUT BOOLEAN *SwapState\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get swap state\r
-\r
-Arguments:\r
+{\r
+ return EFI_SUCCESS;\r
+}\r
\r
- FtwLiteDevice - Calling context\r
- SwapState - Swap state\r
+/**\r
+ Set swap state.\r
+ This is a internal function.\r
\r
-Returns:\r
\r
- EFI_SUCCESS - State successfully got\r
+ @param FtwLiteDevice Indicates a pointer to the calling context.\r
+ @param TopSwap New swap state\r
\r
---*/\r
-{\r
- return EFI_SUCCESS;\r
-}\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ Note:\r
+ the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that\r
+ software will not be able to clear the Top-Swap bit until the system is\r
+ rebooted without GNT[A]# being pulled down.\r
\r
-STATIC\r
+**/\r
EFI_STATUS\r
SetSwapState (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
IN BOOLEAN TopSwap\r
)\r
-/*++\r
+{\r
+ return EFI_SUCCESS;\r
+}\r
\r
-Routine Description:\r
- Set swap state.\r
+/**\r
\r
-Arguments:\r
- FtwLiteDevice - Indicates a pointer to the calling context. \r
- TopSwap - New swap state\r
+ Check whether the block is a boot block.\r
\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
\r
-Note:\r
- the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that\r
- software will not be able to clear the Top-Swap bit until the system is\r
- rebooted without GNT[A]# being pulled down.\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock Fvb protocol instance\r
+ @param Lba Lba value\r
\r
---*/\r
-{\r
- return EFI_SUCCESS;\r
-}\r
+ @retval FALSE This is a boot block.\r
+ @retval TRUE This is not a boot block.\r
\r
+**/\r
BOOLEAN\r
IsBootBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check whether the block is a boot block.\r
-\r
-Arguments:\r
-\r
- FtwLiteDevice - Calling context\r
- FvBlock - Fvb protocol instance\r
- Lba - Lba value\r
-\r
-Returns:\r
-\r
- Is a boot block or not\r
-\r
---*/\r
{\r
//\r
// IPF doesn't support safe bootblock update\r
return FALSE;\r
}\r
\r
-EFI_STATUS\r
-FlushSpareBlockToBootBlock (\r
- EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
+/**\r
+ Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
\r
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to boot block\r
- EFI_INVALID_PARAMETER - Input parameter error\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
\r
-Notes:\r
+ @retval EFI_SUCCESS Spare block content is copied to boot block\r
+ @retval EFI_INVALID_PARAMETER Input parameter error\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+ Notes:\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+FlushSpareBlockToBootBlock (\r
+ EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
+ )\r
{\r
return EFI_SUCCESS;\r
}\r
-/** \r
+/** @file\r
\r
X64 platform related code to support FtwLite.\r
\r
//\r
#define BOOT_BLOCK_BASE\r
\r
-// STATIC\r
+/**\r
+\r
+ Get swap state.\r
+\r
+\r
+ @param FtwLiteDevice Calling context\r
+ @param SwapState Swap state\r
+\r
+ @retval EFI_SUCCESS State successfully read.\r
+\r
+**/\r
EFI_STATUS\r
GetSwapState (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
OUT BOOLEAN *SwapState\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get swap state\r
-\r
-Arguments:\r
+{\r
+ return EFI_SUCCESS;\r
+}\r
\r
- FtwLiteDevice - Calling context\r
- SwapState - Swap state\r
+/**\r
+ Set swap state.\r
\r
-Returns:\r
\r
- EFI_SUCCESS - State successfully got\r
+ @param FtwLiteDevice Indicates a pointer to the calling context.\r
+ @param TopSwap New swap state\r
\r
---*/\r
-{\r
- return EFI_SUCCESS;\r
-}\r
+ @retval EFI_SUCCESS The function completed successfully\r
+ Note:\r
+ the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that\r
+ software will not be able to clear the Top-Swap bit until the system is\r
+ rebooted without GNT[A]# being pulled down.\r
\r
-// STATIC\r
+**/\r
EFI_STATUS\r
SetSwapState (\r
IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
IN BOOLEAN TopSwap\r
)\r
-/*++\r
+{\r
+ return EFI_SUCCESS;\r
+}\r
\r
-Routine Description:\r
- Set swap state.\r
+/**\r
\r
-Arguments:\r
- FtwLiteDevice - Indicates a pointer to the calling context. \r
- TopSwap - New swap state\r
+ Check whether the block is a boot block.\r
\r
-Returns:\r
- EFI_SUCCESS - The function completed successfully\r
\r
-Note:\r
- the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that\r
- software will not be able to clear the Top-Swap bit until the system is\r
- rebooted without GNT[A]# being pulled down.\r
+ @param FtwLiteDevice Calling context\r
+ @param FvBlock Fvb protocol instance\r
+ @param Lba Lba value\r
\r
---*/\r
-{\r
- return EFI_SUCCESS;\r
-}\r
+ @retval FALSE This is a boot block.\r
+ @retval TRUE This is not a boot block.\r
\r
+**/\r
BOOLEAN\r
IsBootBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
EFI_LBA Lba\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check whether the block is a boot block.\r
-\r
-Arguments:\r
+{\r
+ return FALSE;\r
+}\r
\r
- FtwLiteDevice - Calling context\r
- FvBlock - Fvb protocol instance\r
- Lba - Lba value\r
+/**\r
+ Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
+ Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
+ FtwLiteDevice->FtwSpareLba.\r
+ Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
\r
-Returns:\r
\r
- Is a boot block or not\r
+ @param FtwLiteDevice The private data of FTW_LITE driver\r
\r
---*/\r
-{\r
- return FALSE;\r
-}\r
+ @retval EFI_SUCCESS Spare block content is copied to boot block\r
+ @retval EFI_INVALID_PARAMETER Input parameter error\r
+ @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
+ @retval EFI_ABORTED The function could not complete successfully\r
+ Notes:\r
\r
+**/\r
EFI_STATUS\r
FlushSpareBlockToBootBlock (\r
EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
- Spare block is accessed by FTW backup FVB protocol interface. LBA is \r
- FtwLiteDevice->FtwSpareLba.\r
- Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
-\r
-Arguments:\r
- FtwLiteDevice - The private data of FTW_LITE driver\r
-\r
-Returns:\r
- EFI_SUCCESS - Spare block content is copied to boot block\r
- EFI_INVALID_PARAMETER - Input parameter error\r
- EFI_OUT_OF_RESOURCES - Allocate memory error\r
- EFI_ABORTED - The function could not complete successfully\r
-\r
-Notes:\r
-\r
---*/\r
{\r
return EFI_SUCCESS;\r
}\r