1
2
3
4
5
6
7
8
9
10
use super::Error;
use crate::machine::SupportMachine;

pub trait Syscalls<Mac: SupportMachine>: Send + Sync {
    fn initialize(&mut self, machine: &mut Mac) -> Result<(), Error>;
    // Returned bool means if the syscall has been processed, if
    // a module returns false, Machine would continue to leverage
    // the next syscall module to process.
    fn ecall(&mut self, machine: &mut Mac) -> Result<bool, Error>;
}