Barrelfish
Functions
dispatch.c File Reference

Dispatcher architecture-specific implementation. More...

Functions

void disp_arch_init (dispatcher_handle_t handle)
 Architecture-specific dispatcher initialisation.
 
void disp_resume (dispatcher_handle_t handle, arch_registers_state_t *archregs)
 Resume execution of a given register state. More...
 
void disp_switch (dispatcher_handle_t handle, arch_registers_state_t *from_state, arch_registers_state_t *to_state)
 Switch execution between two register states. More...
 
void disp_save (dispatcher_handle_t handle, arch_registers_state_t *state, bool yield, capaddr_t yield_to)
 Save the current register state and optionally yield the CPU. More...
 
void disp_save_rm_kcb (void)
 Save register state, remove our KCB from current CPU.
 

Detailed Description

Dispatcher architecture-specific implementation.

Function Documentation

void disp_resume ( dispatcher_handle_t  handle,
arch_registers_state_t archregs 
)

Resume execution of a given register state.

This function resumes the execution of the given register state on the current dispatcher. It may only be called while the dispatcher is disabled.

Parameters
dispCurrent dispatcher pointer
regsRegister state snapshot
void disp_save ( dispatcher_handle_t  handle,
arch_registers_state_t state,
bool  yield,
capaddr_t  yield_to 
)

Save the current register state and optionally yield the CPU.

This function saves as much as necessary of the current register state (which, when resumed will return to the caller), and then either re-enters the thread scheduler or yields the CPU. It may only be called while the dispatcher is disabled.

Parameters
dispCurrent dispatcher pointer
regsLocation to save current register state
yieldIf true, yield CPU to kernel; otherwise re-run thread scheduler
yield_toEndpoint capability for dispatcher to which we want to yield
void disp_switch ( dispatcher_handle_t  handle,
arch_registers_state_t from_state,
arch_registers_state_t to_state 
)

Switch execution between two register states.

Switch execution between two register states, and turn off disabled activations.

This function saves as much as necessary of the current register state (which, when resumed will return to the caller), and switches execution by resuming the given register state. It may only be called while the dispatcher is disabled.

Parameters
dispCurrent dispatcher pointer
from_regsLocation to save current register state
to_regsLocation from which to resume new register state