Struct Mpidr

Source
pub struct Mpidr {
    pub aff0: u8,
    pub aff1: u8,
    pub aff2: u8,
    pub aff3: Option<u8>,
}
Expand description

The type contains the affinity fields of the MPIDR register. For AArch32 callers this contains Affinity 0, 1, 2 fields and for AAarch64 callers it has Affinity 0, 1, 2, 3 fields.

Fields§

§aff0: u8§aff1: u8§aff2: u8§aff3: Option<u8>

Implementations§

Source§

impl Mpidr

Source

pub const fn from_aff3210(aff3: u8, aff2: u8, aff1: u8, aff0: u8) -> Self

Create Mpidr instance from aff3-0 values

Source

pub const fn from_aff210(aff2: u8, aff1: u8, aff0: u8) -> Self

Create Mpidr instance from aff2-0 values

Source

pub fn from_register_value(mpidr_el1: u64) -> Self

The MPIDR_EL1 register contains bits other then the aff3-0 fields. However the PSCI specification request bits[40:63] and bits[24:31] to be set to zero when forwarding an MPIDR value as an argument of a PSCI function call. Because of this, the TryFrom implementation returns an error if these bits are set. In other cases the Mpidr value is constructed from the MPIDR_EL1 register value of the local core. This function does this by ignoring other bits. Do not use this function for creating Mpidr instance from a PSCI function argument.

Trait Implementations§

Source§

impl Clone for Mpidr

Source§

fn clone(&self) -> Mpidr

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Mpidr

Source§

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

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

impl From<Mpidr> for u64

Source§

fn from(value: Mpidr) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Mpidr

Source§

fn eq(&self, other: &Mpidr) -> 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 TryFrom<Mpidr> for u32

Source§

type Error = Error

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

fn try_from(value: Mpidr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u32> for Mpidr

Source§

type Error = Error

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

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u64> for Mpidr

Source§

type Error = Error

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

fn try_from(value: u64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Mpidr

Source§

impl Eq for Mpidr

Source§

impl StructuralPartialEq for Mpidr

Auto Trait Implementations§

§

impl Freeze for Mpidr

§

impl RefUnwindSafe for Mpidr

§

impl Send for Mpidr

§

impl Sync for Mpidr

§

impl Unpin for Mpidr

§

impl UnwindSafe for Mpidr

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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, 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.