sparreal_kernel::fdt

Struct Fdt

Source
pub struct Fdt<'a> { /* private fields */ }
Expand description

The reference to the FDT raw data.

Implementations§

Source§

impl<'a> Fdt<'a>

Source

pub fn from_bytes(data: &'a [u8]) -> Result<Fdt<'a>, FdtError<'a>>

Create a new FDT from raw data.

Source

pub fn from_ptr(ptr: NonNull<u8>) -> Result<Fdt<'a>, FdtError<'a>>

Create a new FDT from a pointer.

Source

pub fn total_size(&self) -> usize

Source

pub fn version(&self) -> usize

Source

pub fn boot_cpuid_phys(&self) -> u32

This field shall contain the physical ID of the system’s boot CPU. It shall be identical to the physical ID given in the reg property of that CPU node within the devicetree.

Source

pub fn memory_reservation_block(&self) -> impl Iterator<Item = MemoryRegion>

The memory reservation block provides the client program with a list of areas in physical memory which are reserved; that is, which shall not be used for general memory allocations. It is used to protect vital data structures from being overwritten by the client program.

Source

pub fn reserved_memory(&'a self) -> impl Iterator<Item = Node<'a>> + 'a

Reserved memory is specified as a node under the /reserved-memory node. The operating system shall exclude reserved memory from normal usage. One can create child nodes describing particular reserved (excluded from normal use) memory regions. Such memory regions are usually designed for the special usage by various device drivers.

Source

pub fn all_nodes(&'a self) -> impl Iterator<Item = Node<'a>>

Source

pub fn chosen(&'a self) -> Option<Chosen<'a>>

Source

pub fn get_node_by_phandle(&'a self, phandle: Phandle) -> Option<Node<'a>>

Source

pub fn get_node_by_name(&'a self, name: &str) -> Option<Node<'a>>

Source

pub fn find_compatible( &'a self, with: &'a [&'a str], ) -> impl Iterator<Item = Node<'a>> + 'a

Source

pub fn find_nodes( &'a self, path: &'a str, ) -> impl Iterator<Item = Node<'a>> + 'a

if path start with ‘/’ then search by path, else search by aliases

Source

pub fn find_aliase(&'a self, name: &str) -> Option<&'a str>

Source

pub fn memory(&'a self) -> impl Iterator<Item = Memory<'a>> + 'a

Trait Implementations§

Source§

impl<'a> Clone for Fdt<'a>

Source§

fn clone(&self) -> Fdt<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Fdt<'a>

§

impl<'a> RefUnwindSafe for Fdt<'a>

§

impl<'a> Send for Fdt<'a>

§

impl<'a> Sync for Fdt<'a>

§

impl<'a> Unpin for Fdt<'a>

§

impl<'a> UnwindSafe for Fdt<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Background for T

Source§

fn bg(self, rgb: Rgb<u8>) -> WithBackground<T>

Adds the given background color
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> Foreground for T

Source§

fn fg(self, rgb: Rgb<u8>) -> WithForeground<T>

Adds the given foreground color
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.