From 640ee9382042c1587dc1982f468d36588041094f Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 18 May 2025 04:27:26 +0800 Subject: [PATCH] cleanup loader add a note about the dirty flag - it's not "dead" per se, I think it is helpful to leave a bread crumb for future hw revs that might have hardware-enforced dirty bit setting on the PTE. --- loader/src/lib.rs | 4 ++++ loader/src/platform/cramium/update.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/loader/src/lib.rs b/loader/src/lib.rs index 81b4a7bc4..de6b1ef30 100644 --- a/loader/src/lib.rs +++ b/loader/src/lib.rs @@ -22,6 +22,10 @@ pub const FLG_D: usize = 0x80; pub const FLG_P: usize = 0x200; pub const SWAP_FLG_WIRED: u32 = 0x1_00; +// Note: this flag is currently not used. It was an aborted attempt to do +// auto-write on dirty page but due to lack of hw synchronization we couldn't +// guarantee atomicity. Flag can be removed or re-used in the future if another +// attempt is tried on a system that has hardware dirty page updating. pub const SWAP_FLG_DIRTY: u32 = 0x2_00; pub const FLG_SWAP_USED: u32 = 0x8000_0000; diff --git a/loader/src/platform/cramium/update.rs b/loader/src/platform/cramium/update.rs index 418681f9f..afb4691f8 100644 --- a/loader/src/platform/cramium/update.rs +++ b/loader/src/platform/cramium/update.rs @@ -52,6 +52,7 @@ struct SignatureInFlash { pub signature: [u8; 64], } +#[allow(dead_code)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum KeyPress { Up,