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

Fields

which: usize
address: *mut u8

Structure representing an invocation of the Yield system call class. which is the Yield identifier value and address is the no wait field.

Subscribe

Fields

driver_number: usize
subdriver_number: usize
upcall_ptr: *mut ()
appdata: usize

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

Fields

driver_number: usize
subdriver_number: usize
arg0: usize
arg1: usize

Structure representing an invocation of the Command system call class. driver_number is the driver identifier and subdriver_number is the command identifier.

ReadWriteAllow

Fields

driver_number: usize
subdriver_number: usize
allow_address: *mut u8
allow_size: usize

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

Fields

driver_number: usize
subdriver_number: usize
allow_address: *mut u8
allow_size: usize

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

Fields

driver_number: usize
subdriver_number: usize
allow_address: *const u8
allow_size: usize

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

Fields

operand: usize
arg0: usize

Structure representing an invocation of the Memop system call class. operand is the operation and arg0 is the operation argument.

Exit

Fields

which: usize
completion_code: usize

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

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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.