From 1352fafd003d85028c0e2e85f6e986211a4d6c90 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 3 Apr 2026 21:17:28 +0200 Subject: [PATCH] Remove unused InactiveFlusher --- src/arch/aarch64/paging.rs | 7 +++++ src/arch/aarch64/paging/mapper.rs | 23 -------------- src/arch/aarch64/paging/mod.rs | 12 -------- src/arch/riscv64/{paging/mod.rs => paging.rs} | 4 --- src/arch/riscv64/paging/mapper.rs | 30 ------------------- .../x86_shared/{paging/mod.rs => paging.rs} | 5 ---- src/arch/x86_shared/paging/mapper.rs | 23 -------------- 7 files changed, 7 insertions(+), 97 deletions(-) create mode 100644 src/arch/aarch64/paging.rs delete mode 100644 src/arch/aarch64/paging/mapper.rs delete mode 100644 src/arch/aarch64/paging/mod.rs rename src/arch/riscv64/{paging/mod.rs => paging.rs} (82%) delete mode 100644 src/arch/riscv64/paging/mapper.rs rename src/arch/x86_shared/{paging/mod.rs => paging.rs} (61%) delete mode 100644 src/arch/x86_shared/paging/mapper.rs diff --git a/src/arch/aarch64/paging.rs b/src/arch/aarch64/paging.rs new file mode 100644 index 0000000000..a28de73e64 --- /dev/null +++ b/src/arch/aarch64/paging.rs @@ -0,0 +1,7 @@ +/// Initialize MAIR +#[cold] +pub unsafe fn init() { + unsafe { + rmm::aarch64::init_mair(); + } +} diff --git a/src/arch/aarch64/paging/mapper.rs b/src/arch/aarch64/paging/mapper.rs deleted file mode 100644 index c6cc01f8af..0000000000 --- a/src/arch/aarch64/paging/mapper.rs +++ /dev/null @@ -1,23 +0,0 @@ -use crate::{ - ipi::{ipi, IpiKind, IpiTarget}, - memory::RmmA, -}; - -pub use rmm::{Flusher, PageFlush}; - -pub struct InactiveFlusher { - _inner: (), -} -impl Flusher for InactiveFlusher { - fn consume(&mut self, flush: PageFlush) { - // TODO: Push to TLB "mailbox" or tell it to reload CR3 if there are too many entries. - unsafe { - flush.ignore(); - } - } -} -impl Drop for InactiveFlusher { - fn drop(&mut self) { - ipi(IpiKind::Tlb, IpiTarget::Other); - } -} diff --git a/src/arch/aarch64/paging/mod.rs b/src/arch/aarch64/paging/mod.rs deleted file mode 100644 index 8f69cb513e..0000000000 --- a/src/arch/aarch64/paging/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -//! # Paging -//! Some code was borrowed from [Phil Opp's Blog](http://os.phil-opp.com/modifying-page-tables.html) - -pub mod mapper; - -/// Initialize MAIR -#[cold] -pub unsafe fn init() { - unsafe { - rmm::aarch64::init_mair(); - } -} diff --git a/src/arch/riscv64/paging/mod.rs b/src/arch/riscv64/paging.rs similarity index 82% rename from src/arch/riscv64/paging/mod.rs rename to src/arch/riscv64/paging.rs index 7a743cf4b2..996e4963f4 100644 --- a/src/arch/riscv64/paging/mod.rs +++ b/src/arch/riscv64/paging.rs @@ -1,7 +1,3 @@ -#![allow(unused)] - -pub mod mapper; - #[cold] pub unsafe fn init() { // Assuming SBI already set up PMAs correctly for us diff --git a/src/arch/riscv64/paging/mapper.rs b/src/arch/riscv64/paging/mapper.rs deleted file mode 100644 index a8592883f1..0000000000 --- a/src/arch/riscv64/paging/mapper.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::{ - ipi::{ipi, IpiKind, IpiTarget}, - memory::RmmA, -}; - -pub use rmm::{Flusher, PageFlush, PageFlushAll}; - -pub struct InactiveFlusher { - _inner: (), -} -impl InactiveFlusher { - // TODO: cpu id - pub fn new() -> Self { - Self { _inner: () } - } -} - -impl Flusher for InactiveFlusher { - fn consume(&mut self, flush: PageFlush) { - // TODO: Push to TLB "mailbox" or tell it to reload CR3 if there are too many entries. - unsafe { - flush.ignore(); - } - } -} -impl Drop for InactiveFlusher { - fn drop(&mut self) { - ipi(IpiKind::Tlb, IpiTarget::Other); - } -} diff --git a/src/arch/x86_shared/paging/mod.rs b/src/arch/x86_shared/paging.rs similarity index 61% rename from src/arch/x86_shared/paging/mod.rs rename to src/arch/x86_shared/paging.rs index bde7ad9b6c..cbfa2ee897 100644 --- a/src/arch/x86_shared/paging/mod.rs +++ b/src/arch/x86_shared/paging.rs @@ -1,8 +1,3 @@ -//! # Paging -//! Some code was borrowed from [Phil Opp's Blog](http://os.phil-opp.com/modifying-page-tables.html) - -pub mod mapper; - /// Initialize PAT #[cold] pub unsafe fn init() { diff --git a/src/arch/x86_shared/paging/mapper.rs b/src/arch/x86_shared/paging/mapper.rs deleted file mode 100644 index c6cc01f8af..0000000000 --- a/src/arch/x86_shared/paging/mapper.rs +++ /dev/null @@ -1,23 +0,0 @@ -use crate::{ - ipi::{ipi, IpiKind, IpiTarget}, - memory::RmmA, -}; - -pub use rmm::{Flusher, PageFlush}; - -pub struct InactiveFlusher { - _inner: (), -} -impl Flusher for InactiveFlusher { - fn consume(&mut self, flush: PageFlush) { - // TODO: Push to TLB "mailbox" or tell it to reload CR3 if there are too many entries. - unsafe { - flush.ignore(); - } - } -} -impl Drop for InactiveFlusher { - fn drop(&mut self) { - ipi(IpiKind::Tlb, IpiTarget::Other); - } -}