Skip to content

Commit 5ae8fd1

Browse files
aykevldeadprogram
authored andcommitted
machine: clarify WriteAt semantics of BlockDevice
Flash can generally only be written after it has been erased, which wasn't spelled out explicitly in the interface.
1 parent c80da7e commit 5ae8fd1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/machine/flash.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ type BlockDevice interface {
4343
io.ReaderAt
4444

4545
// WriteAt writes the given number of bytes to the block device.
46+
//
47+
// This interface directly writes data to the underlying block device.
48+
// Different kinds of devices have different requirements: most can only
49+
// write data after the page has been erased, and many can only write data
50+
// with specific alignment (such as 4-byte alignment).
4651
io.WriterAt
4752

4853
// Size returns the number of bytes in this block device.

0 commit comments

Comments
 (0)