host_fdt_parser

Struct ParsedDeviceTree

Source
pub struct ParsedDeviceTree<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> {
Show 14 fields pub device_tree_size: usize, pub memory: ArrayVec<MemoryEntry, MAX_MEMORY_ENTRIES>, pub boot_cpuid_phys: u32, pub cpus: ArrayVec<CpuEntry, MAX_CPU_ENTRIES>, pub vmbus_vtl0: Option<VmbusInfo>, pub vmbus_vtl2: Option<VmbusInfo>, pub command_line: ArrayString<MAX_COMMAND_LINE_SIZE>, pub com3_serial: bool, pub gic: Option<GicInfo>, pub memory_allocation_mode: MemoryAllocationMode, pub entropy: Option<ArrayVec<u8, MAX_ENTROPY_SIZE>>, pub device_dma_page_count: Option<u64>, pub nvme_keepalive: bool, pub vtl0_alias_map: Option<u64>,
}
Expand description

Struct containing parsed device tree information.

Fields§

§device_tree_size: usize

Total size of the parsed device tree, in bytes.

§memory: ArrayVec<MemoryEntry, MAX_MEMORY_ENTRIES>

Parsed sorted memory ranges from the device tree.

§boot_cpuid_phys: u32

Boot cpu physical id. On X64, this is the APIC id of the BSP.

§cpus: ArrayVec<CpuEntry, MAX_CPU_ENTRIES>

Information for enabled cpus.

§vmbus_vtl0: Option<VmbusInfo>

VMBUS info for VTL0.

§vmbus_vtl2: Option<VmbusInfo>

VMBUS info for VTL2.

§command_line: ArrayString<MAX_COMMAND_LINE_SIZE>

Command line contained in the /chosen node. FUTURE: return more information from the chosen node.

§com3_serial: bool

Is a com3 device present

§gic: Option<GicInfo>

GIC information

§memory_allocation_mode: MemoryAllocationMode

The vtl2 memory allocation mode OpenHCL should use for memory.

§entropy: Option<ArrayVec<u8, MAX_ENTROPY_SIZE>>

Entropy from the host to be used by the OpenHCL kernel

§device_dma_page_count: Option<u64>

The number of pages the host has provided as a hint for device dma.

This is used to allocate a persistent VTL2 pool on non-isolated guests, to allow devices to stay alive during a servicing operation.

§nvme_keepalive: bool

Indicates that Host does support NVMe keep-alive.

§vtl0_alias_map: Option<u64>

The physical address of the VTL0 alias mapping, if one is configured.

Implementations§

Source§

impl<'a, 'b, const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

Source

pub const fn new() -> Self

Create an empty parsed device tree structure. This is used to construct a valid instance to pass into Self::parse.

Source

pub fn cpu_count(&self) -> usize

The number of enabled cpus.

Source

pub fn parse(dt: &'a [u8], storage: &'b mut Self) -> Result<&'b Self, Error<'a>>

Parse the given device tree.

Trait Implementations§

Source§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> Debug for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> PartialEq for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

Source§

fn eq( &self, other: &ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> Eq for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

Source§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> StructuralPartialEq for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

Auto Trait Implementations§

§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> Freeze for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> RefUnwindSafe for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> Send for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> Sync for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> Unpin for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

§

impl<const MAX_MEMORY_ENTRIES: usize, const MAX_CPU_ENTRIES: usize, const MAX_COMMAND_LINE_SIZE: usize, const MAX_ENTROPY_SIZE: usize> UnwindSafe for ParsedDeviceTree<MAX_MEMORY_ENTRIES, MAX_CPU_ENTRIES, MAX_COMMAND_LINE_SIZE, MAX_ENTROPY_SIZE>

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> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more