//! K402's deliberately narrow first-init exit policy. //! There is no PID1 supervisor yet: both outcomes are explicitly logged and //! then halted in WFE, never silently resumed as an unowned user task. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ExitPolicy { Halt, FatalHalt, } pub const fn classify(code: u64) -> ExitPolicy { if code == 0 { ExitPolicy::Halt } else { ExitPolicy::FatalHalt } } #[cfg(test)] mod tests { use super::*; #[test] fn k402_zero_is_clean_halt_and_every_nonzero_is_fatal() { assert_eq!(classify(0), ExitPolicy::Halt); for code in [1, 42, 255, u64::MAX] { assert_eq!(classify(code), ExitPolicy::FatalHalt); } } }