From 815c082153f7508149a19fc49591ca8fb92eb751 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 21 Jul 2025 19:12:37 +0800 Subject: [PATCH] add breadcrumb for improving the cbo.flush instruction whenever rust stabilizes "zicbom" in RV we can remove the ugly .word hard-coding of the flush instruction. --- services/spinor/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/spinor/src/lib.rs b/services/spinor/src/lib.rs index cd2a8d984..315555835 100644 --- a/services/spinor/src/lib.rs +++ b/services/spinor/src/lib.rs @@ -18,6 +18,15 @@ use num_traits::*; use xous::{CID, Message, send_message}; use xous_ipc::Buffer; +// Note: cbo.flush is coded as a .word because Rust as of 1.87 hasn't stabilized +// the cbo.flush instruction extension. Eventually when zicbom is stabilized, +// we should be able to use: +// +// #[target_feature(enable = "zicbom")] +// +// Annotated onto this function; and we canreplace the ugly hex word with "cbo.flush 0({addr})" +// while also losing the "mv a0, {addr}" that ensures that the argument ends +// up where the .word expects it to be. pub unsafe fn flush_block(addr: usize) { core::arch::asm!( "mv a0, {addr}",