| Crates.io | page_table_entry |
| lib.rs | page_table_entry |
| version | 0.5.5 |
| created_at | 2024-07-16 06:13:53.06227+00 |
| updated_at | 2025-07-05 06:39:52.835142+00 |
| description | Page table entry definition for various hardware architectures |
| homepage | https://github.com/arceos-org/arceos |
| repository | https://github.com/arceos-org/page_table_multiarch |
| max_upload_size | |
| id | 1304682 |
| size | 31,534 |
This crate provides the definition of page table entry for various hardware architectures.
Currently supported architectures and page table entry types:
x86_64::X64PTEaarch64::A64PTEriscv::Rv64PTEloongarch64::LA64PTEAll these types implement the GenericPTE trait, which provides unified
methods for manipulating various page table entries.
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)
);