pub struct FdtManager<'a> {
fdt: Option<Fdt<'a>>,
relocated: bool,
original_addr: Option<usize>,
}Fields§
§fdt: Option<Fdt<'a>>§relocated: bool§original_addr: Option<usize>Implementations§
Source§impl<'a> FdtManager<'a>
impl<'a> FdtManager<'a>
const fn new() -> Self
pub fn init(&mut self, ptr: *const u8) -> Result<(), FdtError>
pub fn get_fdt(&self) -> Option<&Fdt<'a>>
Sourcepub unsafe fn get_mut_manager() -> &'static mut FdtManager<'static>
pub unsafe fn get_mut_manager() -> &'static mut FdtManager<'static>
Returns a mutable reference to the FdtManager for initialization.
§Safety
This function is only safe to call during single-threaded boot initialization. After SMP is enabled, this should not be called.
Sourcepub fn get_manager() -> &'static FdtManager<'static>
pub fn get_manager() -> &'static FdtManager<'static>
Sourceunsafe fn relocate_fdt(&mut self, ptr: *mut u8)
unsafe fn relocate_fdt(&mut self, ptr: *mut u8)
Relocates the FDT to a new address.
§Safety
This function modifies the static FDT address and reinitializes the FdtManager. Ensure that the new address is valid and does not cause memory corruption.
§Parameters
ptr: The pointer to the new FDT address.
§Panics
This function will panic if the FDT has already been relocated.
Sourcepub fn get_initramfs(&self) -> Option<MemoryArea>
pub fn get_initramfs(&self) -> Option<MemoryArea>
Get the initramfs memory area from the device tree
This function searches for the initramfs memory region in the device tree. It looks for the initrd-start/end or linux,initrd-start/end properties in the /chosen node.
§Returns
Option