//! K2125 PID1: holds the power grant, obtains a Reset and an Off ticket and //! cancels both (execution is K2130/K2135's milestone). #![no_std] #![no_main] use turkos_os_feature_user::{call, exit}; const POWER: u64 = 16; const CANCEL: u64 = 17; const REFUSED: u64 = 1 << 63; #[unsafe(no_mangle)] #[unsafe(link_section = ".text._start")] pub extern "C" fn _start(_: u64, _: u64) -> ! { let mut tickets = 0; for op in [2, 1] { let t = call(POWER, op, 0, 0); if t & REFUSED != 0 || t == 0 { exit(0x10 + op) } if call(POWER, op, 0, 0) & REFUSED == 0 { exit(0x20 + op) } if call(CANCEL, 0, 0, 0) != 0 { exit(0x30 + op) } tickets = tickets << 8 | t; } exit(tickets) }