Struct SysCall

Source
pub struct SysCall(/* private fields */);
Expand description

Implementation of the UserspaceKernelBoundary for the RISC-V architecture.

Implementations§

Source§

impl SysCall

Source

pub const unsafe fn new() -> SysCall

Trait Implementations§

Source§

impl UserspaceKernelBoundary for SysCall

Source§

type StoredState = Riscv32iStoredState

Some architecture-specific struct containing per-process state that must be kept while the process is not running. For example, for keeping CPU registers that aren’t stored on the stack. Read more
Source§

fn initial_process_app_brk_size(&self) -> usize

Called by the kernel during process creation to inform the kernel of the minimum amount of process-accessible RAM needed by a new process. This allows for architecture-specific process layout decisions, such as stack pointer initialization. Read more
Source§

unsafe fn initialize_process( &self, accessible_memory_start: *const u8, _app_brk: *const u8, state: &mut Self::StoredState, ) -> Result<(), ()>

Called by the kernel after it has memory allocated to it but before it is allowed to begin executing. Allows for architecture-specific process setup, e.g. allocating a syscall stack frame. Read more
Source§

unsafe fn set_syscall_return_value( &self, _accessible_memory_start: *const u8, _app_brk: *const u8, state: &mut Self::StoredState, return_value: SyscallReturn, ) -> Result<(), ()>

Set the return value the process should see when it begins executing again after the syscall. This will only be called after a process has called a syscall. Read more
Source§

unsafe fn set_process_function( &self, _accessible_memory_start: *const u8, _app_brk: *const u8, state: &mut Riscv32iStoredState, callback: FunctionCall, ) -> Result<(), ()>

Set the function that the process should execute when it is resumed. This has two major uses: 1) sets up the initial function call to _start when the process is started for the very first time; 2) tells the process to execute a upcall function after calling yield(). Read more
Source§

unsafe fn switch_to_process( &self, _accessible_memory_start: *const u8, _app_brk: *const u8, state: &mut Riscv32iStoredState, ) -> (ContextSwitchReason, Option<*const u8>)

Context switch to a specific process. Read more
Source§

unsafe fn print_context( &self, _accessible_memory_start: *const u8, _app_brk: *const u8, state: &Riscv32iStoredState, writer: &mut dyn Write, )

Display architecture specific (e.g. CPU registers or status flags) data for a process identified by the stored state for that process. Read more
Source§

fn store_context( &self, state: &Riscv32iStoredState, out: &mut [u8], ) -> Result<usize, ErrorCode>

Store architecture specific (e.g. CPU registers or status flags) data for a process. On success returns the number of elements written to out.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.