pub struct SysCall(/* private fields */);
Expand description
Implementation of the UserspaceKernelBoundary
for the RISC-V architecture.
Implementations§
Trait Implementations§
Source§impl UserspaceKernelBoundary for SysCall
impl UserspaceKernelBoundary for SysCall
Source§type StoredState = Riscv32iStoredState
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
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<(), ()>
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<(), ()>
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<(), ()>
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 moreSource§unsafe fn switch_to_process(
&self,
_accessible_memory_start: *const u8,
_app_brk: *const u8,
state: &mut Riscv32iStoredState,
) -> (ContextSwitchReason, Option<*const u8>)
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,
)
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>
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§
impl Freeze for SysCall
impl RefUnwindSafe for SysCall
impl Send for SysCall
impl Sync for SysCall
impl Unpin for SysCall
impl UnwindSafe for SysCall
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more