File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ class BlockDevice
85
85
86
86
/* * Erase blocks on a block device
87
87
*
88
- * The state of an erased block is undefined until it has been programmed
88
+ * The state of an erased block is undefined until it has been programmed,
89
+ * unless get_erase_value returns a non-negative byte value
89
90
*
90
91
* @param addr Address of block to begin erasing
91
92
* @param size Size to erase in bytes, must be a multiple of erase block size
@@ -135,6 +136,20 @@ class BlockDevice
135
136
return get_program_size ();
136
137
}
137
138
139
+ /* * Get the value of storage when erased
140
+ *
141
+ * If get_erase_value returns a non-negative byte value, the underlying
142
+ * storage will be set to that value when erased, and storage containing
143
+ * that value can be programmed without another erase.
144
+ *
145
+ * @return The value of storage when erased, or -1 if the value of
146
+ * erased storage can't be relied on
147
+ */
148
+ virtual int get_erase_value () const
149
+ {
150
+ return -1 ;
151
+ }
152
+
138
153
/* * Get the total size of the underlying device
139
154
*
140
155
* @return Size of the underlying device in bytes
You can’t perform that action at this time.
0 commit comments