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
: the Yield identifier valueaddress
: the no wait field
Subscribe
Structure representing an invocation of the Subscribe system call class.
driver_number
: the driver identifiersubdriver_number
: the subscribe identifierupcall_ptr
: upcall pointer to the upcall functionappdata
: userspace application data
Command
Structure representing an invocation of the Command system call class.
driver_number
: the driver identifiersubdriver_number
: the command identifierarg0
: value passed to theCommand
implementationarg1
: value passed to theCommand
implementation
ReadWriteAllow
Structure representing an invocation of the ReadWriteAllow system call class.
driver_number
: the driver identifiersubdriver_number
: the buffer identifierallow_address
: the address where the buffer startsallow_size
: the size of the buffer in bytes
UserspaceReadableAllow
Structure representing an invocation of the ReadWriteAllow system call class, but with shared kernel and app access.
driver_number
: the driver identifiersubdriver_number
: the buffer identifierallow_address
: the address where the buffer startsallow_size
: the size of the buffer in bytes
ReadOnlyAllow
Structure representing an invocation of the ReadOnlyAllow system call class.
driver_number
: the driver identifiersubdriver_number
: the buffer identifierallow_address
: the address where the buffer startsallow_size
: the size of the buffer in bytes
Memop
Structure representing an invocation of the Memop system call class.
operand
: the operationarg0
: the operation argument
Exit
Structure representing an invocation of the Exit system call class.
which
: the exit identifiercompletion_code
: 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.
sourcepub fn driver_number(&self) -> Option<usize>
pub fn driver_number(&self) -> Option<usize>
Get the driver_number
for the syscall classes that use driver numbers.
sourcepub fn subdriver_number(&self) -> Option<usize>
pub fn subdriver_number(&self) -> Option<usize>
Get the subdriver_number
for the syscall classes that use sub driver
numbers.