use num_derive::FromPrimitive;
use num_traits::FromPrimitive;

use crate::arch;

#[derive(FromPrimitive, Debug)]
pub enum Syscall {
    Exit,
    Pid,
    Message,
    MemMap,
    MemUnmap,
    Resolve,
    Spawn,
    Version,
    Yield,
}

#[derive(FromPrimitive, Debug)]
pub enum SyscallStatus {
    Success,
    NoSuchCall,
    NoSuchProcess,
    NoSuchService,
    NoPermission,
    OutOfMemory,
    Aborted,
    Unspecified,
    Unknown,
    Unimplemented,
}

impl From<u64> for SyscallStatus {
    fn from(value: u64) -> Self {
        SyscallStatus::from_u64(value).unwrap_or(Self::Unknown)
    }
}
