pub enum Syscall {
Yield {
which: usize,
address: *mut u8,
},
Subscribe {
driver_number: usize,
subdriver_number: usize,
upcall_ptr: *mut (),
appdata: usize,
},
Command {
driver_number: usize,
subdriver_number: usize,
arg0: usize,
arg1: usize,
},
ReadWriteAllow {
driver_number: usize,
subdriver_number: usize,
allow_address: *mut u8,
allow_size: usize,
},
UserspaceReadableAllow {
driver_number: usize,
subdriver_number: usize,
allow_address: *mut u8,
allow_size: usize,
},
ReadOnlyAllow {
driver_number: usize,
subdriver_number: usize,
allow_address: *const u8,
allow_size: usize,
},
Memop {
operand: usize,
arg0: usize,
},
Exit {
which: usize,
completion_code: usize,
},
}
Expand description
Decoded system calls as defined in TRD 104.
Variants§
Yield
Structure representing an invocation of the Yield system call class.
which
is the Yield identifier value and address
is the no wait field.
Subscribe
Structure representing an invocation of the Subscribe system call
class. driver_number
is the driver identifier, subdriver_number
is the subscribe identifier, upcall_ptr
is upcall pointer,
and appdata
is the application data.
Command
Structure representing an invocation of the Command system call class.
driver_number
is the driver identifier and subdriver_number
is
the command identifier.
ReadWriteAllow
Structure representing an invocation of the ReadWriteAllow system call
class. driver_number
is the driver identifier, subdriver_number
is
the buffer identifier, allow_address
is the address, and allow_size
is the size.
UserspaceReadableAllow
Structure representing an invocation of the ReadWriteAllow system call
class, but with shared kernel and app access. driver_number
is the
driver identifier, subdriver_number
is the buffer identifier,
ReadOnlyAllow
Structure representing an invocation of the ReadOnlyAllow system call
class. driver_number
is the driver identifier, subdriver_number
is
the buffer identifier, allow_address
is the address, and allow_size
is the size.
Memop
Structure representing an invocation of the Memop system call
class. operand
is the operation and arg0
is the operation
argument.
Exit
Structure representing an invocation of the Exit system call
class. which
is the exit identifier and completion_code
is
the completion code passed into the kernel.
Implementations§
source§impl Syscall
impl Syscall
sourcepub fn from_register_arguments(
syscall_number: u8,
r0: usize,
r1: usize,
r2: usize,
r3: usize
) -> Option<Syscall>
pub fn from_register_arguments( 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, representing an typed version of a system
call invocation. The method returns None if the values do not specify
a valid system call.
Different architectures have different ABIs for a process and the kernel to exchange data. The 32-bit ABI for CortexM and RISCV microcontrollers is specified in TRD104.