pub struct SupervisorAddressTranslationAndProtection(/* private fields */);Expand description
The layout of SATP.
Implementations§
Source§impl SupervisorAddressTranslationAndProtection
impl SupervisorAddressTranslationAndProtection
Sourcepub const RSVD1_MASK: u64
pub const RSVD1_MASK: u64
Mask of all reserved-as-1 bits.
Sourcepub const RSVD0_MASK: u64
pub const RSVD0_MASK: u64
Mask of all reserved-as-0 bits.
Sourcepub const DEFAULT: u64
pub const DEFAULT: u64
The default value of the layout, combining all field defaults and reserved-as values.
Sourcepub const MODE_SHIFT: usize = 60
pub const MODE_SHIFT: usize = 60
Bit shift (i.e., the low bit) of mode.
Sourcepub const ASID_SHIFT: usize = 44
pub const ASID_SHIFT: usize = 44
Bit shift (i.e., the low bit) of asid.
Sourcepub const FIELDS: [FieldMetadata<u64>; 3]
pub const FIELDS: [FieldMetadata<u64>; 3]
Metadata of all named fields in the layout.
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new instance with reserved-as-1 bits set and
all other bits zeroed (i.e., with a value of
Self::RSVD1_MASK).
pub const fn bits(self) -> u64
Sourcepub fn mode(&self) -> TranslationModewhere
TranslationMode: TryFromBytes,
pub fn mode(&self) -> TranslationModewhere
TranslationMode: TryFromBytes,
The value of SupervisorAddressTranslationAndProtection[63:60].
§Panics
Panics if the field’s bit pattern is not a valid value of the custom representation. Use Self::try_mode to recover from invalid bit patterns.
Sourcepub fn try_mode(&self) -> Result<TranslationMode, InvalidBits<u8>>where
TranslationMode: TryFromBytes,
pub fn try_mode(&self) -> Result<TranslationMode, InvalidBits<u8>>where
TranslationMode: TryFromBytes,
Fallible variant of Self::mode.
Sourcepub fn set_mode(&mut self, value: TranslationMode) -> &mut Self
pub fn set_mode(&mut self, value: TranslationMode) -> &mut Self
Sets the value of SupervisorAddressTranslationAndProtection[63:60].
Source§impl SupervisorAddressTranslationAndProtection
impl SupervisorAddressTranslationAndProtection
Sourcepub fn root_address(&self) -> u64
pub fn root_address(&self) -> u64
Returns the root page table physical address (PPN << 12).
Sourcepub fn set_root_address(&mut self, addr: u64) -> &mut Self
pub fn set_root_address(&mut self, addr: u64) -> &mut Self
Sets the root page table physical address (must be 4KiB-aligned).
Trait Implementations§
Source§impl Binary for SupervisorAddressTranslationAndProtection
impl Binary for SupervisorAddressTranslationAndProtection
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
Source§impl Clone for SupervisorAddressTranslationAndProtection
impl Clone for SupervisorAddressTranslationAndProtection
Source§fn clone(&self) -> SupervisorAddressTranslationAndProtection
fn clone(&self) -> SupervisorAddressTranslationAndProtection
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SupervisorAddressTranslationAndProtection
Source§impl Debug for SupervisorAddressTranslationAndProtection
impl Debug for SupervisorAddressTranslationAndProtection
Source§impl Default for SupervisorAddressTranslationAndProtection
impl Default for SupervisorAddressTranslationAndProtection
Source§fn default() -> Self
fn default() -> Self
Returns an instance with the default bits set (i.e,. with a
value of Self::DEFAULT.
impl Eq for SupervisorAddressTranslationAndProtection
Source§impl From<SupervisorAddressTranslationAndProtection> for u64
impl From<SupervisorAddressTranslationAndProtection> for u64
Source§fn from(value: SupervisorAddressTranslationAndProtection) -> Self
fn from(value: SupervisorAddressTranslationAndProtection) -> Self
Source§impl From<u64> for SupervisorAddressTranslationAndProtection
impl From<u64> for SupervisorAddressTranslationAndProtection
Source§impl IntoIterator for SupervisorAddressTranslationAndProtection
impl IntoIterator for SupervisorAddressTranslationAndProtection
Source§impl<'a> IntoIterator for &'a SupervisorAddressTranslationAndProtection
impl<'a> IntoIterator for &'a SupervisorAddressTranslationAndProtection
Source§impl LowerHex for SupervisorAddressTranslationAndProtection
impl LowerHex for SupervisorAddressTranslationAndProtection
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
Source§impl Octal for SupervisorAddressTranslationAndProtection
impl Octal for SupervisorAddressTranslationAndProtection
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
Source§impl PartialEq for SupervisorAddressTranslationAndProtection
impl PartialEq for SupervisorAddressTranslationAndProtection
impl StructuralPartialEq for SupervisorAddressTranslationAndProtection
Source§impl UpperHex for SupervisorAddressTranslationAndProtection
impl UpperHex for SupervisorAddressTranslationAndProtection
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Resultwhere
TranslationMode: Debug,
Auto Trait Implementations§
impl Freeze for SupervisorAddressTranslationAndProtection
impl RefUnwindSafe for SupervisorAddressTranslationAndProtection
impl Send for SupervisorAddressTranslationAndProtection
impl Sync for SupervisorAddressTranslationAndProtection
impl Unpin for SupervisorAddressTranslationAndProtection
impl UnsafeUnpin for SupervisorAddressTranslationAndProtection
impl UnwindSafe for SupervisorAddressTranslationAndProtection
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
§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)
clone_to_uninit)