pub enum Syscall {
Yield {
which: usize,
param_a: usize,
param_b: usize,
},
Subscribe {
driver_number: usize,
subdriver_number: usize,
upcall_ptr: CapabilityPtr,
appdata: CapabilityPtr,
},
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 TRD104.
Variants§
Yield
Structure representing an invocation of the SyscallClass::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.
Fields
upcall_ptr: CapabilityPtr
Upcall pointer to the upcall function.
appdata: CapabilityPtr
Userspace application data.
Command
Structure representing an invocation of the Command system call class.
Fields
ReadWriteAllow
Structure representing an invocation of the ReadWriteAllow system call class.
Fields
UserspaceReadableAllow
Structure representing an invocation of the UserspaceReadableAllow system call class that allows shared kernel and app access.
Fields
ReadOnlyAllow
Structure representing an invocation of the ReadOnlyAllow system call class.
Fields
Memop
Structure representing an invocation of the Memop system call class.
Exit
Structure representing an invocation of the Exit system call class.
Implementations§
Source§impl Syscall
impl Syscall
Sourcepub fn from_register_arguments(
syscall_number: u8,
r0: usize,
r1: CapabilityPtr,
r2: CapabilityPtr,
r3: CapabilityPtr,
) -> Option<Syscall>
pub fn from_register_arguments( syscall_number: u8, r0: usize, r1: CapabilityPtr, r2: CapabilityPtr, r3: CapabilityPtr, ) -> 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.