diff --git a/rmm/src/arch/riscv64/mod.rs b/rmm/src/arch/riscv64/mod.rs index 647c364372..bcb65af052 100644 --- a/rmm/src/arch/riscv64/mod.rs +++ b/rmm/src/arch/riscv64/mod.rs @@ -8,6 +8,5 @@ bitflags::bitflags! { pub struct EntryFlags: usize { const NO_CACHE = 1 << 4; const DEV_MEM = 0; - const WRITE_COMBINING = 0; } } diff --git a/rmm/src/arch/x86_shared.rs b/rmm/src/arch/x86_shared.rs index 66e760657f..b05c4f3339 100644 --- a/rmm/src/arch/x86_shared.rs +++ b/rmm/src/arch/x86_shared.rs @@ -1,8 +1,6 @@ bitflags::bitflags! { pub struct EntryFlags: usize { const NO_CACHE = 1 << 4; - const HUGE_PAGE = 1 << 7; - const GLOBAL = 1 << 8; const DEV_MEM = 0; } } diff --git a/src/scheme/memory.rs b/src/scheme/memory.rs index c5634117e3..4415aa95d1 100644 --- a/src/scheme/memory.rs +++ b/src/scheme/memory.rs @@ -149,23 +149,20 @@ impl MemoryScheme { // Default MemoryType::Writeback => (), - #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] // TODO: AARCH64 - MemoryType::WriteCombining => { - page_flags = page_flags.custom_flag(EntryFlags::HUGE_PAGE.bits(), true) - } + MemoryType::WriteCombining => page_flags = page_flags.write_combining(true), MemoryType::Uncacheable => { page_flags = page_flags.custom_flag(EntryFlags::NO_CACHE.bits(), true) } - // MemoryType::DeviceMemory doesn't exist on x86 && x86_64, which instead support - // uncacheable, write-combining, write-through, write-protect, and write-back. - #[cfg(target_arch = "aarch64")] MemoryType::DeviceMemory => { - page_flags = page_flags.custom_flag(EntryFlags::DEV_MEM.bits(), true) + // MemoryType::DeviceMemory doesn't exist on x86 && x86_64, which instead support + // uncacheable, write-combining, write-through, write-protect, and write-back. + #[cfg(target_arch = "aarch64")] + { + page_flags = page_flags.custom_flag(EntryFlags::DEV_MEM.bits(), true); + } } - - _ => (), } Grant::physmap(