Struct atopology::MACHINE_TOPOLOGY [−][src]
A struct that contains all information about current machine we’re running on (discovered from ACPI Tables and cpuid).
Should have some of the following:
- Cores, NUMA nodes, Memory regions
- Interrupt routing (I/O APICs, overrides) (TODO)
- PCIe root complexes (TODO)
Methods from Deref<Target = MachineInfo>
pub fn current_thread(&'static self) -> &'static Thread
[src]
Returns the current thread we’re running on.
Notes
Uses cpuid to determine the current APIC ID, then uses the id to find the corresponding thread.
This is not an incredibly fast function since cpuid will clobber your registers unnecessarily. Ideally, call this once then cache.
You also need to ensure that execution is not migrated to
another core during execution of current_thread
.
pub fn num_threads(&self) -> usize
[src]
Return the amount of threads in the system.
pub fn threads(&'static self) -> impl Iterator<Item = &Thread>
[src]
Return iterator over all threads in the system.
pub fn num_cores(&self) -> usize
[src]
Return the amount of cores in the system.
pub fn cores(&'static self) -> impl Iterator<Item = &Core>
[src]
Return iterator over all cores in the system.
pub fn num_packages(&self) -> usize
[src]
Return the amount of packages in the system.
pub fn packages(&'static self) -> impl Iterator<Item = &Package>
[src]
Return iterator over all packages in the system.
pub fn nodes(&'static self) -> impl Iterator<Item = &Node>
[src]
Return iterator over all NUMA nodes in the system.
pub fn num_nodes(&self) -> usize
[src]
Return the amount of NUMA nodes in the system.
pub fn io_apics(&'static self) -> impl Iterator<Item = &IoApic>
[src]
Return an iterator over all I/O APICs in the system.
Trait Implementations
impl Deref for MACHINE_TOPOLOGY
[src]
type Target = MachineInfo
The resulting type after dereferencing.
fn deref(&self) -> &MachineInfo
[src]
impl LazyStatic for MACHINE_TOPOLOGY
[src]
fn initialize(lazy: &Self)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,