- Writes specified number of bytes from the input buffer to the block\r
-\r
- @param Instance The FV instance to be written to\r
- @param Lba The starting logical block index to write to\r
- @param Offset Offset into the block at which to begin writing\r
- @param NumBytes Pointer that on input contains the total size of\r
- the buffer. On output, it contains the total number\r
- of bytes actually written\r
- @param Buffer Pointer to a caller allocated buffer that contains\r
- the source for the write\r
-\r
- @retval EFI_INVALID_PARAMETER Invalid parameter\r
- @retval EFI_SUCESS Sucess to write block\r
- @retval Others Fail to write block\r
+ Writes specified number of bytes from the input buffer to the block\r
+\r
+ The EfiFvbWriteBlock() function writes the specified number of bytes\r
+ from the provided buffer to the specified block and offset in the \r
+ requested firmware volume. \r
+\r
+ If the firmware volume is sticky write, the caller must ensure that\r
+ all the bits of the specified range to write are in the EFI_FVB_ERASE_POLARITY\r
+ state before calling the EfiFvbWriteBlock() function, or else the \r
+ result will be unpredictable. This unpredictability arises because,\r
+ for a sticky-write firmware volume, a write may negate a bit in the \r
+ EFI_FVB_ERASE_POLARITY state but it cannot flip it back again. In \r
+ general, before calling the EfiFvbWriteBlock() function, the caller\r
+ should call the EfiFvbEraseBlock() function first to erase the specified\r
+ block to write. A block erase cycle will transition bits from the\r
+ (NOT)EFI_FVB_ERASE_POLARITY state back to the EFI_FVB_ERASE_POLARITY state.\r
+ Implementations should be mindful that the firmware volume might be \r
+ in the WriteDisabled state. If it is in this state, the EfiFvbWriteBlock()\r
+ function must return the status code EFI_ACCESS_DENIED without modifying\r
+ the contents of the firmware volume.\r
+ \r
+ The EfiFvbWriteBlock() function must also prevent spanning block boundaries.\r
+ If a write is requested that spans a block boundary, the write must store\r
+ up to the boundary but not beyond. The output parameter NumBytes must be \r
+ set to correctly indicate the number of bytes actually written. The caller\r
+ must be aware that a write may be partially completed.\r
+ All writes, partial or otherwise, must be fully flushed to the hardware \r
+ before the EfiFvbWriteBlock() function returns. \r
+ \r
+ If NumBytes is NULL, then ASSERT().\r
+\r
+ @param Instance The FV instance to be written to\r
+ @param Lba The starting logical block index to write to\r
+ @param Offset The offset relative to the block, at which to begin writting.\r
+ @param NumBytes Pointer to a UINTN. On input, *NumBytes contains\r
+ the total size of the buffer. On output, it contains\r
+ the actual number of bytes written.\r
+ @param Buffer Pointer to a caller allocated buffer that contains\r
+ the source for the write\r
+\r
+ @retval EFI_SUCCESS The firmware volume was written successfully.\r
+ @retval EFI_BAD_BUFFER_SIZE The write was attempted across an LBA boundary. \r
+ On output, NumBytes contains the total number of bytes actually written.\r
+ @retval EFI_ACCESS_DENIED The firmware volume is in the WriteDisabled state.\r
+ @retval EFI_DEVICE_ERROR The block device is malfunctioning and could not be written.\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter, Instance is larger than the max FVB number. \r
+ Lba index is larger than the last block of the firmware volume.\r
+ Offset is larger than the block size.\r