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.
This commit is contained in:
bunnie 2025-07-21 19:12:37 +08:00
parent 6eaf3501bd
commit 815c082153

View file

@ -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}",