pub enum Segment {
Direct {
addr: u32,
cached: Cached,
},
Mapped,
Invalid,
}Expand description
Which segment a virtual address falls in, and how it translates.
Variants§
Direct
Unmapped: physical address is the virtual one minus the segment base.
Mapped
TLB-mapped: KUSEG, KSSEG or KSEG3. The TLB decides the physical address
and the cacheability, from the matching entry’s C field.
Invalid
Not a valid address in this mode: raises an address error before the TLB is consulted.
A distinct variant rather than a TlbFault, because the two produce
different exceptions from different vectors. Folding an out-of-range
kernel address into a TLB refill would send a user program to the refill
handler, where a well-behaved kernel would map the page and hand it the
access it was never allowed to make.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Segment
impl<'de> Deserialize<'de> for Segment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Segment
impl Eq for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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
Mutably borrows from an owned value. Read more