pub struct ApicIdDecoder { /* private fields */ }Expand description
ApicIdDecoder is a utility for extracting particular topological level
IDs from an (x2)APIC ID.
In full generality, an APIC ID might decompose as follows:
§[intel/vol3]: Figure 8-5. Generalized Seven Level Interpretation of the APIC ID.
§| CLUSTER ID | PACKAGE ID | DIE ID | TILE ID | MODULE ID | CORE ID | SMT ID |
where the full ID width is 32-bit (if x2APIC) or 8-bit.
§This, however, is higher fidelity than we are able to make use of. Since
CLUSTER ID and PACKAGE_ID are not directly enumerable from CPUID, we elide
the two IDs into a single PACKAGE ID, defined as the rest of the ID above
DIE. Moreover, the system currently has no use for enumerating tiles and
modules directly (which is also a practice that AMD does not do): we elide
the TILE and MODULE IDs into DIE ID alone. Accordingly, ApicIdDecoder
partitions up the APIC address space as
§| PACKAGE ID | DIE ID | CORE ID | SMT ID |
Implementations§
Source§impl ApicIdDecoder
impl ApicIdDecoder
Sourcepub fn from_cpuid(cpuid: impl Cpuid) -> Self
pub fn from_cpuid(cpuid: impl Cpuid) -> Self
Constructs a new ApicIdDecoder by querying the given Cpuid.
Sourcepub const fn core_id(&self, apic_id: u32) -> u32
pub const fn core_id(&self, apic_id: u32) -> u32
Extracts the Core ID from the provided APIC ID.
Sourcepub const fn package_id(&self, apic_id: u32) -> u32
pub const fn package_id(&self, apic_id: u32) -> u32
Extracts the Package ID from the provided APIC ID.
Sourcepub const fn smt_id_width(&self) -> usize
pub const fn smt_id_width(&self) -> usize
Returns the bit width allocated to the SMT ID.
Sourcepub const fn core_id_cumulative_width(&self) -> usize
pub const fn core_id_cumulative_width(&self) -> usize
Returns the cumulative bit width allocated to Core and SMT IDs.
Sourcepub const fn die_id_cumulative_width(&self) -> usize
pub const fn die_id_cumulative_width(&self) -> usize
Returns the cumulative bit width allocated to Die, Core, and SMT IDs.
Trait Implementations§
Source§impl Clone for ApicIdDecoder
impl Clone for ApicIdDecoder
Source§fn clone(&self) -> ApicIdDecoder
fn clone(&self) -> ApicIdDecoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ApicIdDecoder
Source§impl Debug for ApicIdDecoder
impl Debug for ApicIdDecoder
Source§impl Default for ApicIdDecoder
impl Default for ApicIdDecoder
Source§fn default() -> ApicIdDecoder
fn default() -> ApicIdDecoder
Returns the “default value” for a type. Read more
impl Eq for ApicIdDecoder
Source§impl PartialEq for ApicIdDecoder
impl PartialEq for ApicIdDecoder
impl StructuralPartialEq for ApicIdDecoder
Auto Trait Implementations§
impl Freeze for ApicIdDecoder
impl RefUnwindSafe for ApicIdDecoder
impl Send for ApicIdDecoder
impl Sync for ApicIdDecoder
impl Unpin for ApicIdDecoder
impl UnsafeUnpin for ApicIdDecoder
impl UnwindSafe for ApicIdDecoder
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)