//! K2145 racing client: attempts two new writes while shutdown quiesce is //! active (both rejected with ESHUTDOWN = 108) and checks that premature //! require_quiesced is refused while in-flight writes are still draining. #![no_std] #![no_main] use turkos_os_feature_user::{call, exit}; const WRITE: u64 = 16; const REQUIRE_QUIESCED: u64 = 19; const WORK: u64 = 20; const REFUSED: u64 = 1 << 63; const ESHUTDOWN: u64 = 108; #[unsafe(no_mangle)] #[unsafe(link_section = ".text._start")] pub extern "C" fn _start(_: u64, _: u64) -> ! { if call(WRITE, 64, 0x3333, 0) != (REFUSED | ESHUTDOWN) { exit(1) } if call(WRITE, 32, 0x4444, 0) != (REFUSED | ESHUTDOWN) { exit(2) } if call(REQUIRE_QUIESCED, 0, 0, 0) & REFUSED == 0 { exit(3) } let mut done = 0; for _ in 0..4 { done = call(WORK, 0, 0, 0); } exit(done) }