libkernel: arm64: memory: add a MemoryType AT to PaMapper

Allow implementors of the `PaMapper` trait to choose a type which
represents a memory type when mapping a PA region.
This commit is contained in:
Matthew Leach
2026-04-11 06:46:10 +01:00
parent dbc01b8977
commit 3423d738e6

View File

@@ -36,6 +36,9 @@ pub trait TableMapper: PageTableEntry {
/// A descriptor that maps a physical address (L1, L2 blocks and L3 page).
pub trait PaMapper: PageTableEntry {
/// A type that encodes different types of memory for this architecture.
type MemoryType;
/// Constructs a new valid page descriptor that maps a physical address.
fn new_map_pa(page_address: PA, memory_type: MemoryType, perms: PtePermissions) -> Self;
@@ -200,6 +203,8 @@ macro_rules! define_descriptor {
}
impl PaMapper for $name {
type MemoryType = MemoryType;
fn map_shift() -> usize { $tbl_shift }
fn could_map(region: PhysMemoryRegion, va: VA) -> bool {