18 releases

Uses new Rust 2024

0.5.5 Jul 5, 2025
0.5.3 Mar 3, 2025
0.5.0 Dec 17, 2024
0.4.1 Oct 10, 2024
0.3.1 Jul 31, 2024

#388 in Hardware support

Download history 1133/week @ 2025-07-14 776/week @ 2025-07-21 695/week @ 2025-07-28 933/week @ 2025-08-04 1386/week @ 2025-08-11 1537/week @ 2025-08-18 1157/week @ 2025-08-25 895/week @ 2025-09-01 1677/week @ 2025-09-08 699/week @ 2025-09-15 1188/week @ 2025-09-22 342/week @ 2025-09-29 584/week @ 2025-10-06 430/week @ 2025-10-13 442/week @ 2025-10-20 403/week @ 2025-10-27

1,886 downloads per month
Used in 22 crates (14 directly)

GPL-3.0-or-later OR Apache-2…

30KB
608 lines

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)
);

Dependencies

~735KB
~13K SLoC