PageTableEntry

Struct PageTableEntry 

Source
pub struct PageTableEntry(u64);

Tuple Fields§

§0: u64

Trait Implementations§

Source§

impl Clone for PageTableEntry

Source§

fn clone(&self) -> PageTableEntry

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PageTableEntry

Source§

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

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

impl Ord for PageTableEntry

Source§

fn cmp(&self, other: &PageTableEntry) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PageTableEntry for PageTableEntry

Source§

type Bits = u64

用于表示页表项的底层位模式类型
Source§

fn from_bits(bits: Self::Bits) -> Self

从位模式创建页表项
Source§

fn to_bits(&self) -> Self::Bits

获取页表项的位模式
Source§

fn empty() -> Self

创建一个空的(无效的)页表项
Source§

fn new_leaf(ppn: Ppn, flags: UniversalPTEFlag) -> Self

创建一个新的叶节点(普通页映射)
Source§

fn new_table(ppn: Ppn) -> Self

创建一个新的表节点(指向下一级页表)
Source§

fn is_valid(&self) -> bool

检查页表项是否有效
Source§

fn is_huge(&self) -> bool

检查页表项是否为巨页映射(如果支持)
Source§

fn is_empty(&self) -> bool

检查页表项是否为空
Source§

fn ppn(&self) -> Ppn

获取页表项中存储的物理页号(Ppn)
Source§

fn flags(&self) -> UniversalPTEFlag

获取页表项的通用标志
Source§

fn set_ppn(&mut self, ppn: Ppn)

设置页表项的物理页号
Source§

fn set_flags(&mut self, flags: UniversalPTEFlag)

设置页表项的标志
Source§

fn clear(&mut self)

清空页表项(使其无效)
Source§

fn remove_flags(&mut self, flags: UniversalPTEFlag)

移除指定的标志
Source§

fn add_flags(&mut self, flags: UniversalPTEFlag)

添加指定的标志
Source§

impl PageTableInner<PageTableEntry> for PageTableInner

Source§

const LEVELS: usize = 3usize

Source§

const MAX_VA_BITS: usize = 39usize

Source§

const MAX_PA_BITS: usize = 56usize

Source§

fn tlb_flush(vpn: Vpn)

Source§

fn tlb_flush_all()

Source§

fn is_user_table(&self) -> bool

Source§

fn activate(ppn: Ppn)

Source§

fn activating_table_ppn() -> Ppn

Source§

fn new() -> Self

Source§

fn from_ppn(ppn: Ppn) -> Self

Source§

fn new_as_kernel_table() -> Self

Source§

fn root_ppn(&self) -> Ppn

Source§

fn get_entry( &self, vpn: Vpn, level: usize, ) -> Option<(PageTableEntry, PageSize)>

Source§

fn translate(&self, vaddr: Vaddr) -> Option<Paddr>

Source§

fn map( &mut self, vpn: Vpn, ppn: Ppn, _page_size: PageSize, flags: UniversalPTEFlag, ) -> Result<(), PagingError>

Source§

fn unmap(&mut self, vpn: Vpn) -> Result<(), PagingError>

Source§

fn mvmap( &mut self, vpn: Vpn, target_ppn: Ppn, page_size: PageSize, flags: UniversalPTEFlag, ) -> Result<(), PagingError>

Source§

fn update_flags( &mut self, vpn: Vpn, flags: UniversalPTEFlag, ) -> Result<(), PagingError>

Source§

fn walk( &self, vpn: Vpn, ) -> Result<(Ppn, PageSize, UniversalPTEFlag), PagingError>

Source§

impl PartialEq for PageTableEntry

Source§

fn eq(&self, other: &PageTableEntry) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

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 PartialOrd for PageTableEntry

Source§

fn partial_cmp(&self, other: &PageTableEntry) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for PageTableEntry

Source§

impl Eq for PageTableEntry

Source§

impl StructuralPartialEq for PageTableEntry

Auto Trait Implementations§

§

impl Freeze for PageTableEntry

§

impl RefUnwindSafe for PageTableEntry

§

impl Send for PageTableEntry

§

impl Sync for PageTableEntry

§

impl Unpin for PageTableEntry

§

impl UnwindSafe for PageTableEntry

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.