Skip to main content

CapReg

Struct CapReg 

Source
pub struct CapReg(/* private fields */);
Expand description

Capability Register (MMIO offset 0x008, 64-bit, RO). §10.4.2.

Reports hardware capabilities to software. Key fields control the supported address widths, large page sizes, fault recording, and domain count.

Implementations§

Source§

impl CapReg

Source

pub const fn new() -> Self

Creates a new default initialized bitfield.

Source

pub const fn from_bits(bits: u64) -> Self

Convert from bits.

Source

pub const fn into_bits(self) -> u64

Convert into bits.

Source

pub const fn nd(&self) -> u8

Number of domains supported (3 bits). See NumDomains.

Bits: 0..3

Source

pub const fn with_nd_checked(self, value: u8) -> Result<Self, ()>

Number of domains supported (3 bits). See NumDomains.

Bits: 0..3

Source

pub const fn with_nd(self, value: u8) -> Self

Number of domains supported (3 bits). See NumDomains.

Bits: 0..3

Source

pub const fn set_nd(&mut self, value: u8)

Number of domains supported (3 bits). See NumDomains.

Bits: 0..3

Source

pub const fn set_nd_checked(&mut self, value: u8) -> Result<(), ()>

Number of domains supported (3 bits). See NumDomains.

Bits: 0..3

Source

pub const fn afl(&self) -> bool

Advanced Fault Logging (not supported in emulator).

Bits: 3..4

Source

pub const fn with_afl_checked(self, value: bool) -> Result<Self, ()>

Advanced Fault Logging (not supported in emulator).

Bits: 3..4

Source

pub const fn with_afl(self, value: bool) -> Self

Advanced Fault Logging (not supported in emulator).

Bits: 3..4

Source

pub const fn set_afl(&mut self, value: bool)

Advanced Fault Logging (not supported in emulator).

Bits: 3..4

Source

pub const fn set_afl_checked(&mut self, value: bool) -> Result<(), ()>

Advanced Fault Logging (not supported in emulator).

Bits: 3..4

Source

pub const fn rwbf(&self) -> bool

Required Write-Buffer Flushing — 0 = not required.

Bits: 4..5

Source

pub const fn with_rwbf_checked(self, value: bool) -> Result<Self, ()>

Required Write-Buffer Flushing — 0 = not required.

Bits: 4..5

Source

pub const fn with_rwbf(self, value: bool) -> Self

Required Write-Buffer Flushing — 0 = not required.

Bits: 4..5

Source

pub const fn set_rwbf(&mut self, value: bool)

Required Write-Buffer Flushing — 0 = not required.

Bits: 4..5

Source

pub const fn set_rwbf_checked(&mut self, value: bool) -> Result<(), ()>

Required Write-Buffer Flushing — 0 = not required.

Bits: 4..5

Source

pub const fn plmr(&self) -> bool

Protected Low-Memory Region support.

Bits: 5..6

Source

pub const fn with_plmr_checked(self, value: bool) -> Result<Self, ()>

Protected Low-Memory Region support.

Bits: 5..6

Source

pub const fn with_plmr(self, value: bool) -> Self

Protected Low-Memory Region support.

Bits: 5..6

Source

pub const fn set_plmr(&mut self, value: bool)

Protected Low-Memory Region support.

Bits: 5..6

Source

pub const fn set_plmr_checked(&mut self, value: bool) -> Result<(), ()>

Protected Low-Memory Region support.

Bits: 5..6

Source

pub const fn phmr(&self) -> bool

Protected High-Memory Region support.

Bits: 6..7

Source

pub const fn with_phmr_checked(self, value: bool) -> Result<Self, ()>

Protected High-Memory Region support.

Bits: 6..7

Source

pub const fn with_phmr(self, value: bool) -> Self

Protected High-Memory Region support.

Bits: 6..7

Source

pub const fn set_phmr(&mut self, value: bool)

Protected High-Memory Region support.

Bits: 6..7

Source

pub const fn set_phmr_checked(&mut self, value: bool) -> Result<(), ()>

Protected High-Memory Region support.

Bits: 6..7

Source

pub const fn cm(&self) -> bool

Caching Mode — 0 = non-caching (walk tables on every access).

Bits: 7..8

Source

pub const fn with_cm_checked(self, value: bool) -> Result<Self, ()>

Caching Mode — 0 = non-caching (walk tables on every access).

Bits: 7..8

Source

pub const fn with_cm(self, value: bool) -> Self

Caching Mode — 0 = non-caching (walk tables on every access).

Bits: 7..8

Source

pub const fn set_cm(&mut self, value: bool)

Caching Mode — 0 = non-caching (walk tables on every access).

Bits: 7..8

Source

pub const fn set_cm_checked(&mut self, value: bool) -> Result<(), ()>

Caching Mode — 0 = non-caching (walk tables on every access).

Bits: 7..8

Source

pub const fn sagaw(&self) -> u8

Supported Adjusted Guest Address Widths (5 bits). Bit 0 (reserved), bit 1 = 39-bit (3-level), bit 2 = 48-bit (4-level), bit 3 = 57-bit (5-level), bit 4 (reserved).

Bits: 8..13

Source

pub const fn with_sagaw_checked(self, value: u8) -> Result<Self, ()>

Supported Adjusted Guest Address Widths (5 bits). Bit 0 (reserved), bit 1 = 39-bit (3-level), bit 2 = 48-bit (4-level), bit 3 = 57-bit (5-level), bit 4 (reserved).

Bits: 8..13

Source

pub const fn with_sagaw(self, value: u8) -> Self

Supported Adjusted Guest Address Widths (5 bits). Bit 0 (reserved), bit 1 = 39-bit (3-level), bit 2 = 48-bit (4-level), bit 3 = 57-bit (5-level), bit 4 (reserved).

Bits: 8..13

Source

pub const fn set_sagaw(&mut self, value: u8)

Supported Adjusted Guest Address Widths (5 bits). Bit 0 (reserved), bit 1 = 39-bit (3-level), bit 2 = 48-bit (4-level), bit 3 = 57-bit (5-level), bit 4 (reserved).

Bits: 8..13

Source

pub const fn set_sagaw_checked(&mut self, value: u8) -> Result<(), ()>

Supported Adjusted Guest Address Widths (5 bits). Bit 0 (reserved), bit 1 = 39-bit (3-level), bit 2 = 48-bit (4-level), bit 3 = 57-bit (5-level), bit 4 (reserved).

Bits: 8..13

Source

pub const fn mgaw(&self) -> u8

Maximum Guest Address Width (6 bits) — value is MGAW-1. 47 = 48-bit address width.

Bits: 16..22

Source

pub const fn with_mgaw_checked(self, value: u8) -> Result<Self, ()>

Maximum Guest Address Width (6 bits) — value is MGAW-1. 47 = 48-bit address width.

Bits: 16..22

Source

pub const fn with_mgaw(self, value: u8) -> Self

Maximum Guest Address Width (6 bits) — value is MGAW-1. 47 = 48-bit address width.

Bits: 16..22

Source

pub const fn set_mgaw(&mut self, value: u8)

Maximum Guest Address Width (6 bits) — value is MGAW-1. 47 = 48-bit address width.

Bits: 16..22

Source

pub const fn set_mgaw_checked(&mut self, value: u8) -> Result<(), ()>

Maximum Guest Address Width (6 bits) — value is MGAW-1. 47 = 48-bit address width.

Bits: 16..22

Source

pub const fn zlr(&self) -> bool

Zero-Length Read — 1 = supports zero-length read requests.

Bits: 22..23

Source

pub const fn with_zlr_checked(self, value: bool) -> Result<Self, ()>

Zero-Length Read — 1 = supports zero-length read requests.

Bits: 22..23

Source

pub const fn with_zlr(self, value: bool) -> Self

Zero-Length Read — 1 = supports zero-length read requests.

Bits: 22..23

Source

pub const fn set_zlr(&mut self, value: bool)

Zero-Length Read — 1 = supports zero-length read requests.

Bits: 22..23

Source

pub const fn set_zlr_checked(&mut self, value: bool) -> Result<(), ()>

Zero-Length Read — 1 = supports zero-length read requests.

Bits: 22..23

Source

pub const fn fro(&self) -> u16

Fault Recording Register Offset (10 bits). Offset in 16-byte units from register base. FRO=0x12 → offset 0x120.

Bits: 24..34

Source

pub const fn with_fro_checked(self, value: u16) -> Result<Self, ()>

Fault Recording Register Offset (10 bits). Offset in 16-byte units from register base. FRO=0x12 → offset 0x120.

Bits: 24..34

Source

pub const fn with_fro(self, value: u16) -> Self

Fault Recording Register Offset (10 bits). Offset in 16-byte units from register base. FRO=0x12 → offset 0x120.

Bits: 24..34

Source

pub const fn set_fro(&mut self, value: u16)

Fault Recording Register Offset (10 bits). Offset in 16-byte units from register base. FRO=0x12 → offset 0x120.

Bits: 24..34

Source

pub const fn set_fro_checked(&mut self, value: u16) -> Result<(), ()>

Fault Recording Register Offset (10 bits). Offset in 16-byte units from register base. FRO=0x12 → offset 0x120.

Bits: 24..34

Source

pub const fn sllps(&self) -> u8

Second-Level Large Page Support (4 bits). Bit 0 = 2MB (21-bit), bit 1 = 1GB (30-bit).

Bits: 34..38

Source

pub const fn with_sllps_checked(self, value: u8) -> Result<Self, ()>

Second-Level Large Page Support (4 bits). Bit 0 = 2MB (21-bit), bit 1 = 1GB (30-bit).

Bits: 34..38

Source

pub const fn with_sllps(self, value: u8) -> Self

Second-Level Large Page Support (4 bits). Bit 0 = 2MB (21-bit), bit 1 = 1GB (30-bit).

Bits: 34..38

Source

pub const fn set_sllps(&mut self, value: u8)

Second-Level Large Page Support (4 bits). Bit 0 = 2MB (21-bit), bit 1 = 1GB (30-bit).

Bits: 34..38

Source

pub const fn set_sllps_checked(&mut self, value: u8) -> Result<(), ()>

Second-Level Large Page Support (4 bits). Bit 0 = 2MB (21-bit), bit 1 = 1GB (30-bit).

Bits: 34..38

Source

pub const fn psi(&self) -> bool

Page-Selective Invalidation support.

Bits: 39..40

Source

pub const fn with_psi_checked(self, value: bool) -> Result<Self, ()>

Page-Selective Invalidation support.

Bits: 39..40

Source

pub const fn with_psi(self, value: bool) -> Self

Page-Selective Invalidation support.

Bits: 39..40

Source

pub const fn set_psi(&mut self, value: bool)

Page-Selective Invalidation support.

Bits: 39..40

Source

pub const fn set_psi_checked(&mut self, value: bool) -> Result<(), ()>

Page-Selective Invalidation support.

Bits: 39..40

Source

pub const fn nfr(&self) -> u8

Number of Fault Recording registers minus 1 (8 bits). NFR=0 means 1 fault record.

Bits: 40..48

Source

pub const fn with_nfr_checked(self, value: u8) -> Result<Self, ()>

Number of Fault Recording registers minus 1 (8 bits). NFR=0 means 1 fault record.

Bits: 40..48

Source

pub const fn with_nfr(self, value: u8) -> Self

Number of Fault Recording registers minus 1 (8 bits). NFR=0 means 1 fault record.

Bits: 40..48

Source

pub const fn set_nfr(&mut self, value: u8)

Number of Fault Recording registers minus 1 (8 bits). NFR=0 means 1 fault record.

Bits: 40..48

Source

pub const fn set_nfr_checked(&mut self, value: u8) -> Result<(), ()>

Number of Fault Recording registers minus 1 (8 bits). NFR=0 means 1 fault record.

Bits: 40..48

Source

pub const fn mamv(&self) -> u8

Maximum Address Mask Value (6 bits) for page-selective invalidation.

Bits: 48..54

Source

pub const fn with_mamv_checked(self, value: u8) -> Result<Self, ()>

Maximum Address Mask Value (6 bits) for page-selective invalidation.

Bits: 48..54

Source

pub const fn with_mamv(self, value: u8) -> Self

Maximum Address Mask Value (6 bits) for page-selective invalidation.

Bits: 48..54

Source

pub const fn set_mamv(&mut self, value: u8)

Maximum Address Mask Value (6 bits) for page-selective invalidation.

Bits: 48..54

Source

pub const fn set_mamv_checked(&mut self, value: u8) -> Result<(), ()>

Maximum Address Mask Value (6 bits) for page-selective invalidation.

Bits: 48..54

Source

pub const fn dwd(&self) -> bool

DMA Write Draining — 1 = hardware drains write buffers.

Bits: 54..55

Source

pub const fn with_dwd_checked(self, value: bool) -> Result<Self, ()>

DMA Write Draining — 1 = hardware drains write buffers.

Bits: 54..55

Source

pub const fn with_dwd(self, value: bool) -> Self

DMA Write Draining — 1 = hardware drains write buffers.

Bits: 54..55

Source

pub const fn set_dwd(&mut self, value: bool)

DMA Write Draining — 1 = hardware drains write buffers.

Bits: 54..55

Source

pub const fn set_dwd_checked(&mut self, value: bool) -> Result<(), ()>

DMA Write Draining — 1 = hardware drains write buffers.

Bits: 54..55

Source

pub const fn drd(&self) -> bool

DMA Read Draining — 1 = hardware drains read requests.

Bits: 55..56

Source

pub const fn with_drd_checked(self, value: bool) -> Result<Self, ()>

DMA Read Draining — 1 = hardware drains read requests.

Bits: 55..56

Source

pub const fn with_drd(self, value: bool) -> Self

DMA Read Draining — 1 = hardware drains read requests.

Bits: 55..56

Source

pub const fn set_drd(&mut self, value: bool)

DMA Read Draining — 1 = hardware drains read requests.

Bits: 55..56

Source

pub const fn set_drd_checked(&mut self, value: bool) -> Result<(), ()>

DMA Read Draining — 1 = hardware drains read requests.

Bits: 55..56

Source

pub const fn fl1gp(&self) -> bool

First-Level 1GB page support (not used in legacy mode).

Bits: 56..57

Source

pub const fn with_fl1gp_checked(self, value: bool) -> Result<Self, ()>

First-Level 1GB page support (not used in legacy mode).

Bits: 56..57

Source

pub const fn with_fl1gp(self, value: bool) -> Self

First-Level 1GB page support (not used in legacy mode).

Bits: 56..57

Source

pub const fn set_fl1gp(&mut self, value: bool)

First-Level 1GB page support (not used in legacy mode).

Bits: 56..57

Source

pub const fn set_fl1gp_checked(&mut self, value: bool) -> Result<(), ()>

First-Level 1GB page support (not used in legacy mode).

Bits: 56..57

Source

pub const fn pi(&self) -> bool

Page-walk Incoherency — 1 = page walk results may be incoherent.

Bits: 59..60

Source

pub const fn with_pi_checked(self, value: bool) -> Result<Self, ()>

Page-walk Incoherency — 1 = page walk results may be incoherent.

Bits: 59..60

Source

pub const fn with_pi(self, value: bool) -> Self

Page-walk Incoherency — 1 = page walk results may be incoherent.

Bits: 59..60

Source

pub const fn set_pi(&mut self, value: bool)

Page-walk Incoherency — 1 = page walk results may be incoherent.

Bits: 59..60

Source

pub const fn set_pi_checked(&mut self, value: bool) -> Result<(), ()>

Page-walk Incoherency — 1 = page walk results may be incoherent.

Bits: 59..60

Trait Implementations§

Source§

impl Clone for CapReg

Source§

fn clone(&self) -> CapReg

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 CapReg

Source§

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

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

impl Default for CapReg

Source§

fn default() -> Self

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

impl From<CapReg> for u64

Source§

fn from(v: CapReg) -> u64

Converts to this type from the input type.
Source§

impl From<u64> for CapReg

Source§

fn from(v: u64) -> Self

Converts to this type from the input type.
Source§

impl Inspect for CapReg

Source§

fn inspect(&self, req: Request<'_>)

Inspects the object.
Source§

impl Copy for CapReg

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more