pub struct Boundary;
Expand description
Defines the usermode-kernelmode ABI for x86 platforms.
Implementations§
Trait Implementations§
Source§impl UserspaceKernelBoundary for Boundary
impl UserspaceKernelBoundary for Boundary
Source§type StoredState = UserContext
type StoredState = UserContext
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 Self::StoredState,
upcall: FunctionCall,
) -> Result<(), ()>
unsafe fn set_process_function( &self, accessible_memory_start: *const u8, app_brk: *const u8, state: &mut Self::StoredState, upcall: 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 Self::StoredState,
) -> (ContextSwitchReason, Option<*const u8>)
unsafe fn switch_to_process( &self, accessible_memory_start: *const u8, app_brk: *const u8, state: &mut Self::StoredState, ) -> (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: &Self::StoredState,
writer: &mut dyn Write,
)
unsafe fn print_context( &self, _accessible_memory_start: *const u8, _app_brk: *const u8, state: &Self::StoredState, 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: &Self::StoredState,
_out: &mut [u8],
) -> Result<usize, ErrorCode>
fn store_context( &self, _state: &Self::StoredState, _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 Boundary
impl RefUnwindSafe for Boundary
impl Send for Boundary
impl Sync for Boundary
impl Unpin for Boundary
impl UnwindSafe for Boundary
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