L1Section

Struct L1Section 

Source
pub struct L1Section { /* private fields */ }
Expand description

1 MB section translation entry, mapping a 1 MB region to a physical address.

The ARM Cortex-A architecture programmers manual chapter 9.4 (p.163) or the ARMv7-A and ArmV7-R architecture reference manual p.1323 specify these attributes in more detail.

Implementations§

Source§

impl L1Section

Source

pub const ZERO: Self

Creates a new instance with a raw value of 0. Equivalent to [Self::new_with_raw_value(0)].

Source

pub const DEFAULT: Self

An instance that uses the default value 0

Source

pub const fn new() -> Self

👎Deprecated: Use L1Section::Default (or L1Section::DEFAULT in const context) instead

Creates a new instance of this struct using the default value

Source

pub const fn raw_value(&self) -> u32

Returns the underlying raw value of this bitfield

Source

pub const fn new_with_raw_value(value: u32) -> L1Section

Creates a new instance of this bitfield with the given raw value.

No checks are performed on the value, so it is possible to set bits that don’t have any accessors specified.

Source

pub const fn builder() -> PartialL1Section<0>

Creates a builder for this bitfield which ensures that all writable fields are initialized

Source

pub const fn base_addr_upper_bits(&self) -> u12

Section base address upper bits.

Source

pub const fn with_base_addr_upper_bits(&self, field_value: u12) -> Self

Section base address upper bits.

Source

pub fn set_base_addr_upper_bits(&mut self, field_value: u12)

Section base address upper bits.

Source

pub const fn ng(&self) -> bool

Non-global bit.

Source

pub const fn with_ng(&self, field_value: bool) -> Self

Non-global bit.

Source

pub fn set_ng(&mut self, field_value: bool)

Non-global bit.

Source

pub const fn s(&self) -> bool

Shareable bit.

Source

pub const fn with_s(&self, field_value: bool) -> Self

Shareable bit.

Source

pub fn set_s(&mut self, field_value: bool)

Shareable bit.

Source

pub const fn apx(&self) -> bool

Source

pub const fn with_apx(&self, field_value: bool) -> Self

Source

pub fn set_apx(&mut self, field_value: bool)

Source

pub const fn tex(&self) -> u3

Type extension bits.

Source

pub const fn with_tex(&self, field_value: u3) -> Self

Type extension bits.

Source

pub fn set_tex(&mut self, field_value: u3)

Type extension bits.

Source

pub const fn ap(&self) -> u2

Source

pub const fn with_ap(&self, field_value: u2) -> Self

Source

pub fn set_ap(&mut self, field_value: u2)

Source

pub const fn p_bit(&self) -> bool

Source

pub const fn with_p_bit(&self, field_value: bool) -> Self

Source

pub fn set_p_bit(&mut self, field_value: bool)

Source

pub const fn domain(&self) -> u4

Source

pub const fn with_domain(&self, field_value: u4) -> Self

Source

pub fn set_domain(&mut self, field_value: u4)

Source

pub const fn xn(&self) -> bool

Source

pub const fn with_xn(&self, field_value: bool) -> Self

Source

pub fn set_xn(&mut self, field_value: bool)

Source

pub const fn c(&self) -> bool

Source

pub const fn with_c(&self, field_value: bool) -> Self

Source

pub fn set_c(&mut self, field_value: bool)

Source

pub const fn b(&self) -> bool

Source

pub const fn with_b(&self, field_value: bool) -> Self

Source

pub fn set_b(&mut self, field_value: bool)

Source

pub const fn entry_type(&self) -> L1EntryType

Source

pub const fn with_entry_type(&self, field_value: L1EntryType) -> Self

Source

pub fn set_entry_type(&mut self, field_value: L1EntryType)

Source§

impl L1Section

Source

pub const fn new_with_addr_and_attrs( phys_addr: u32, section_attrs: SectionAttributes, ) -> Self

Generates a new L1 section from a physical address and section attributes.

The uppermost 12 bits of the physical address define which 1 MB of virtual address space are being accessed. They will be stored in the L1 section table. This address MUST be aligned to 1 MB.

§Panics

Physcal address not aligned to 1 MB.

Source

pub fn section_attrs(&self) -> Result<SectionAttributes, InvalidL1EntryType>

Retrieve the section attributes.

Source

pub fn set_section_attrs(&mut self, section_attrs: SectionAttributes)

Set the section attributes without changing the address.

Source

pub const fn new_with_addr_upper_bits_and_attrs( addr_upper_twelve_bits: u12, section_attrs: SectionAttributes, ) -> Self

Create a new L1 section with the given upper 12 bits of the address and section attributes.

Trait Implementations§

Source§

impl Clone for L1Section

Source§

fn clone(&self) -> L1Section

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 L1Section

Source§

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

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

impl Default for L1Section

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for L1Section

Source§

fn eq(&self, other: &L1Section) -> 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 Copy for L1Section

Source§

impl Eq for L1Section

Source§

impl StructuralPartialEq for L1Section

Auto Trait Implementations§

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.