Struct HeaderOffsets
pub struct HeaderOffsets {
pub vid_header_offset: u32,
pub data_offset: u32,
}Expand description
Offsets of the VID header and the data in each erase block.
The flash decides them, and super::ImageReader needs them because an
image doesn’t store them.
Fields§
§vid_header_offset: u32Offset of the super::VidHeader.
data_offset: u32Offset of the data.
Implementations§
§impl HeaderOffsets
impl HeaderOffsets
pub fn from_io_sizes(min_io_size: u32, subpage_size: u32) -> Option<Self>
pub fn from_io_sizes(min_io_size: u32, subpage_size: u32) -> Option<Self>
Returns the offsets that the kernel and ubinize use by default.
The VID header starts at the first multiple of subpage_size after
the EC header, and the data at the first multiple of min_io_size
after the VID header. min_io_size is the page size, as in
flashkit_mtd::Geometry::page_size. NAND with subpages writes the
headers in smaller units. Its subpage size is in
/sys/class/mtd/mtdN/subpagesize. Without subpages, it equals the
page size.
Returns None if a size isn’t a power of two, the subpage size is
larger than min_io_size or an offset doesn’t fit into a u32.
Trait Implementations§
§impl Clone for HeaderOffsets
impl Clone for HeaderOffsets
§fn clone(&self) -> HeaderOffsets
fn clone(&self) -> HeaderOffsets
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more