mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-04-18 06:08:09 -04:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user