Struct mycelium_kernel::arch::interrupt::apic::io::RedirectionEntry
source · pub struct RedirectionEntry(/* private fields */);
Implementations§
source§impl RedirectionEntry
impl RedirectionEntry
pub const VECTOR: Pack64<u8, RedirectionEntry> = _
pub const DELIVERY: Pack64<DeliveryMode, RedirectionEntry> = _
sourcepub const DEST_MODE: Pack64<DestinationMode, RedirectionEntry> = _
pub const DEST_MODE: Pack64<DestinationMode, RedirectionEntry> = _
Destination mode.
Physical (0) or logical (1). If this is physical mode, then bits 56-59 should contain an APIC ID. If this is logical mode, then those bits contain a set of processors.
sourcepub const QUEUED: Pack64<bool, RedirectionEntry> = _
pub const QUEUED: Pack64<bool, RedirectionEntry> = _
Set if this interrupt is going to be sent, but the APIC is busy. Read only.
pub const POLARITY: Pack64<PinPolarity, RedirectionEntry> = _
sourcepub const REMOTE_IRR: Pack64<bool, RedirectionEntry> = _
pub const REMOTE_IRR: Pack64<bool, RedirectionEntry> = _
Remote IRR.
Used for level triggered interrupts only to show if a local APIC has received the interrupt (= 1), or has sent an EOI (= 0). Read only.
pub const TRIGGER: Pack64<TriggerMode, RedirectionEntry> = _
pub const MASKED: Pack64<bool, RedirectionEntry> = _
sourcepub const DESTINATION: Pack64<u8, RedirectionEntry> = _
pub const DESTINATION: Pack64<u8, RedirectionEntry> = _
Destination field.
If the destination mode bit was clear, then the lower 4 bits contain the bit APIC ID to sent the interrupt to. If the bit was set, the upper 4 bits also contain a set of processors. (See below)
sourcepub const fn from_bits(bits: u64) -> RedirectionEntry
pub const fn from_bits(bits: u64) -> RedirectionEntry
Constructs a new instance of Self
from the provided raw bits.
sourcepub const fn new() -> RedirectionEntry
pub const fn new() -> RedirectionEntry
Constructs a new instance of Self
with all bits set to 0.
sourcepub fn with<T>(
self,
field: Pack64<T, RedirectionEntry>,
value: T
) -> RedirectionEntry
pub fn with<T>( self, field: Pack64<T, RedirectionEntry>, value: T ) -> RedirectionEntry
Packs the bit representation of value
into self
at the bit
range designated by field
, returning a new bitfield.
sourcepub fn set<T>(
&mut self,
field: Pack64<T, RedirectionEntry>,
value: T
) -> &mut RedirectionEntry
pub fn set<T>( &mut self, field: Pack64<T, RedirectionEntry>, value: T ) -> &mut RedirectionEntry
Packs the bit representation of value
into self
at the range
designated by field
, mutating self
in place.
sourcepub fn get<T>(self, field: Pack64<T, RedirectionEntry>) -> T
pub fn get<T>(self, field: Pack64<T, RedirectionEntry>) -> T
Unpacks the bit range represented by field
from self
, and
converts it into a T
-typed value.
Panics
This method panics if self
does not contain a valid bit
pattern for a T
-typed value, as determined by T
’s
FromBits::try_from_bits
implementation.
sourcepub fn try_get<T>(
self,
field: Pack64<T, RedirectionEntry>
) -> Result<T, <T as FromBits<u64>>::Error>
pub fn try_get<T>( self, field: Pack64<T, RedirectionEntry> ) -> Result<T, <T as FromBits<u64>>::Error>
Unpacks the bit range represented by field
from self
and attempts to convert it into a T
-typed value.
Returns
Ok(T)
if aT
-typed value could be constructed from the bits insrc
Err(T::Error)
ifsrc
does not contain a valid bit pattern for aT
-typed value, as determined byT
’s [FromBits::try_from_bits
implementation.
sourcepub fn assert_valid()
pub fn assert_valid()
Asserts that all the packing specs for this type are valid.
This is intended to be used in unit tests.
sourcepub fn display_ascii(&self) -> impl Display
pub fn display_ascii(&self) -> impl Display
Returns a value that formats this bitfield in a multi-line format, using only ASCII characters.
This is equivalent to formatting this bitfield using a {}
display specifier, but will never use Unicode box-drawing
characters, even when an upstream formatter uses the {:#}
fmt::Display
specifier. This is intended for use on platforms
where Unicode box drawing characters are never available.
sourcepub fn display_unicode(&self) -> impl Display
pub fn display_unicode(&self) -> impl Display
Returns a value that formats this bitfield in a multi-line format, always using Unicode box-drawing characters.
This is equivalent to formatting this bitfield using a {:#}
format specifier, but will always use Unicode box-drawing
characters, even when an upstream formatter uses the {}
fmt::Display
specifier.
Trait Implementations§
source§impl Binary for RedirectionEntry
impl Binary for RedirectionEntry
source§impl Clone for RedirectionEntry
impl Clone for RedirectionEntry
source§fn clone(&self) -> RedirectionEntry
fn clone(&self) -> RedirectionEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RedirectionEntry
impl Debug for RedirectionEntry
source§impl Display for RedirectionEntry
impl Display for RedirectionEntry
source§impl From<u64> for RedirectionEntry
impl From<u64> for RedirectionEntry
source§fn from(val: u64) -> RedirectionEntry
fn from(val: u64) -> RedirectionEntry
source§impl LowerHex for RedirectionEntry
impl LowerHex for RedirectionEntry
source§impl UpperHex for RedirectionEntry
impl UpperHex for RedirectionEntry
impl Copy for RedirectionEntry
Auto Trait Implementations§
impl RefUnwindSafe for RedirectionEntry
impl Send for RedirectionEntry
impl Sync for RedirectionEntry
impl Unpin for RedirectionEntry
impl UnwindSafe for RedirectionEntry
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.