pub struct Header {
pub magic: u32,
pub totalsize: u32,
pub off_dt_struct: u32,
pub off_dt_strings: u32,
pub off_mem_rsvmap: u32,
pub version: u32,
pub last_comp_version: u32,
pub boot_cpuid_phys: u32,
pub size_dt_strings: u32,
pub size_dt_struct: u32,
}Fields§
§magic: u32FDT header magic
totalsize: u32Total size in bytes of the FDT structure
off_dt_struct: u32Offset in bytes from the start of the header to the structure block
off_dt_strings: u32Offset in bytes from the start of the header to the strings block
off_mem_rsvmap: u32Offset in bytes from the start of the header to the memory reservation block
version: u32FDT version
last_comp_version: u32Last compatible FDT version
boot_cpuid_phys: u32System boot CPU ID
size_dt_strings: u32Length in bytes of the strings block
size_dt_struct: u32Length in bytes of the struct block
Implementations§
Source§impl Header
impl Header
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, FdtError>
pub fn from_bytes(data: &[u8]) -> Result<Self, FdtError>
Read a header from a byte slice and return an owned Header whose
fields are converted from big-endian (on-disk) to host order.
Sourcepub unsafe fn from_ptr(ptr: *mut u8) -> Result<Self, FdtError>
pub unsafe fn from_ptr(ptr: *mut u8) -> Result<Self, FdtError>
Read a header from a raw pointer and return an owned Header whose
fields are converted from big-endian (on-disk) to host order.
§Safety
The caller must ensure that the pointer is valid and points to a
memory region of at least size_of::<Header>() bytes that contains a
valid device tree blob.