From 2a2863c11ac6905b2d93b548aea3a0dc839fde64 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 26 Oct 2025 13:35:57 +0800 Subject: [PATCH] put keystore in charge of enabling preemption this is done after critical setup is done. it doesn't guarantee that it has an infinite time slice, but it makes the startup sequence more deterministic. --- services/keystore/src/platform/baosec.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/keystore/src/platform/baosec.rs b/services/keystore/src/platform/baosec.rs index 428bef578..6e9a47dbc 100644 --- a/services/keystore/src/platform/baosec.rs +++ b/services/keystore/src/platform/baosec.rs @@ -12,8 +12,12 @@ use xous_ipc::Buffer; const WELL_KNOWN_KEY: &'static str = "0000000000000000000000000000000000000000000000000000000000000000"; pub fn keystore(sid: SID) -> ! { + let hal = bao1x_hal_service::Hal::new(); + let mut msg_opt = None; + // allow preemption once the keystore has claimed locks on all its critical resources + hal.set_preemption(true); loop { xous::reply_and_receive_next(sid, &mut msg_opt).unwrap(); let msg = msg_opt.as_mut().unwrap();