//! K2130 unauthorized shell tool: denied power-off request and refused direct //! arm_off without a ticket, then completes its work units. #![no_std] #![no_main] use turkos_os_feature_user::{call, exit}; const REQUEST: u64 = 16; const ARM_OFF: u64 = 17; const WORK: u64 = 18; const REFUSED: u64 = 1 << 63; #[unsafe(no_mangle)] #[unsafe(link_section = ".text._start")] pub extern "C" fn _start(_: u64, _: u64) -> ! { if call(REQUEST, 1, 0, 0) & REFUSED == 0 { exit(1) } if call(ARM_OFF, 0, 0, 0) & REFUSED == 0 { exit(2) } let mut done = 0; for _ in 0..4 { done = call(WORK, 0, 0, 0); } exit(done) }