api level changes to allow wdt to move earlier in boot

right now the inability to move the WDT object through the
hardware manager is causing it to be initialized fairly late
in boot which makes it less useful for recovering from boot
failures
This commit is contained in:
bunnie 2026-05-05 23:58:17 +08:00
parent 47821910dd
commit 8c8ad3ab94

View file

@ -207,6 +207,16 @@ impl Wdt {
}
}
/// reveals the internal CSR address for the WDT. The recipient of this address must promise
/// not to do any concurrent access with the donor; the primary purpose of this method is to
/// provide a method for moving the CSR between threads
pub unsafe fn to_raw(&self) -> usize { self.csr.base() as usize }
/// create a WDT from an internal CSR address. The caller must guarantee that the donor
/// of the address has released the address, and also that the address is in fact a valid
/// mapping for the WDT.
pub unsafe fn from_raw(mem: usize) -> Self { Wdt { csr: CSR::new(mem as *mut u32) } }
// -- Lock helpers ---------------------------------------------------------
#[inline]