page_table_entry

Crates.iopage_table_entry
lib.rspage_table_entry
version0.4.1
sourcesrc
created_at2024-07-16 06:13:53.06227
updated_at2024-10-10 11:11:56.272956
descriptionPage table entry definition for various hardware architectures
homepagehttps://github.com/arceos-org/arceos
repositoryhttps://github.com/arceos-org/page_table_multiarch
max_upload_size
id1304682
size23,252
Yuekai Jia (equation314)

documentation

https://docs.rs/page_table_entry

README

page_table_entry

Crates.io Docs.rs CI

This crate provides the definition of page table entry for various hardware architectures.

Currently supported architectures and page table entry types:

All these types implement the GenericPTE trait, which provides unified methods for manipulating various page table entries.

Examples (x86_64)

use memory_addr::PhysAddr;
use x86_64::structures::paging::page_table::PageTableFlags;
use page_table_entry::{GenericPTE, MappingFlags, x86_64::X64PTE};

let paddr = PhysAddr::from(0x233000);
let pte = X64PTE::new_page(
    paddr,
    /* flags: */ MappingFlags::READ | MappingFlags::WRITE,
    /* is_huge: */ false,
);
assert!(!pte.is_unused());
assert!(pte.is_present());
assert_eq!(pte.paddr(), paddr);
assert_eq!(
    pte.bits(),
    0x800_0000000233_003, // PRESENT | WRITE | NO_EXECUTE | paddr(0x233000)
);
Commit count: 28

cargo fmt