//\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