[][src]Function kernel::syscall::arguments_to_syscall

pub fn arguments_to_syscall(
    syscall_number: u8,
    r0: usize,
    r1: usize,
    r2: usize,
    r3: usize
) -> Option<Syscall>

Helper function for converting raw values passed back from an application into a Syscall type in Tock.

Different architectures may have different mechanisms for passing information about what syscall an app called, but they will have have to convert the series of raw values into a more useful Rust type. While implementations are free to do this themselves, this provides a generic helper function which should help reduce duplicated code.

The mappings between raw syscall_number values and the associated syscall type are specified and fixed by Tock. After that, this function only converts raw values to more meaningful types based on the syscall.