- The EraseBlock() function erases one or more blocks as denoted by the \r
- variable argument list. The entire parameter list of blocks must be verified\r
- prior to erasing any blocks. If a block is requested that does not exist \r
- within the associated firmware volume (it has a larger index than the last \r
- block of the firmware volume), the EraseBlock() function must return\r
- EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
-\r
- @param This Calling context\r
- @param ... Starting LBA followed by Number of Lba to erase. a -1 to terminate\r
- the list.\r
-\r
- @retval EFI_INVALID_PARAMETER\r
- @retval EFI_DEVICE_ERROR\r
- @retval EFI_SUCCESS\r
- @retval EFI_ACCESS_DENIED\r
+ The Write() function writes the specified number of bytes from\r
+ the provided buffer to the specified block and offset. If the\r
+ firmware volume is sticky write, the caller must ensure that\r
+ all the bits of the specified range to write are in the\r
+ EFI_FVB_ERASE_POLARITY state before calling the Write()\r
+ function, or else the result will be unpredictable. This\r
+ unpredictability arises because, for a sticky-write firmware\r
+ volume, a write may negate a bit in the EFI_FVB_ERASE_POLARITY\r
+ state but it cannot flip it back again. In general, before\r
+ calling the Write() function, the caller should call the\r
+ EraseBlocks() function first to erase the specified block to\r
+ write. A block erase cycle will transition bits from the\r
+ (NOT)EFI_FVB_ERASE_POLARITY state back to the\r
+ EFI_FVB_ERASE_POLARITY state. Implementations should be\r
+ mindful that the firmware volume might be in the WriteDisabled\r
+ state. If it is in this state, the Write() function must\r
+ return the status code EFI_ACCESS_DENIED without modifying the\r
+ contents of the firmware volume. The Write() function must\r
+ also prevent spanning block boundaries. If a write is\r
+ requested that spans a block boundary, the write must store up\r
+ to the boundary but not beyond. The output parameter NumBytes\r
+ must be set to correctly indicate the number of bytes actually\r
+ written. The caller must be aware that a write may be\r
+ partially completed. All writes, partial or otherwise, must be\r
+ fully flushed to the hardware before the Write() service\r
+ returns.\r
+\r
+ @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL\r
+ instance.\r
+ \r
+ @param Lba The starting logical block index to write to. Type\r
+ EFI_LBA is defined in the BLOCK_IO Protocol\r
+ (section 11.6) in the UEFI 2.0 specification.\r
+ Offset Offset into the block at which to begin\r
+ writing.\r
+ \r
+ @param NumBytes Pointer to a UINTN. At entry, *NumBytes\r
+ contains the total size of the buffer. At\r
+ exit, *NumBytes contains the total number of\r
+ bytes actually written.\r
+ \r
+ @param Buffer Pointer to a caller-allocated buffer that\r
+ contains the source for the write.\r
+ \r
+ @retval EFI_SUCCESS The firmware volume was written\r
+ successfully.\r
+ \r
+ @retval EFI_BAD_BUFFER_SIZE The write was attempted across an\r
+ LBA boundary. On output, NumBytes\r
+ contains the total number of bytes\r
+ actually written.\r
+ \r
+ @retval EFI_ACCESS_DENIED The firmware volume is in the\r
+ WriteDisabled state.\r
+ \r
+ @retval EFI_DEVICE_ERROR The block device is malfunctioning\r
+ and could not be written.\r
+\r