L4Re Operating System Framework
Interface and Usage Documentation
|
C++ implementation of the vCPU save state area. More...
#include <vcpu>
Public Member Functions | |
void | irq_disable () throw () |
Disable the vCPU for event delivery. | |
unsigned | irq_disable_save () throw () |
Disable the vCPU for event delivery and return previous state. | |
State * | state () throw () |
Get state word. | |
State | state () const throw () |
Get state word. | |
State * | saved_state () throw () |
Get saved_state word. | |
State | saved_state () const throw () |
Get saved_state word. | |
l4_uint16_t | sticky_flags () const throw () |
Get sticky flags. | |
void | irq_enable (l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc) throw () |
Enable the vCPU for event delivery. | |
void | irq_restore (unsigned s, l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc) throw () |
Restore a previously saved IRQ/event state. | |
void | wait_for_event (l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc) throw () |
Wait for event. | |
void | task (L4::Cap< L4::Task > const task=L4::Cap< L4::Task >::Invalid) throw () |
Set the task of the vCPU. | |
int | is_page_fault_entry () const |
Return whether the entry reason was a page fault. | |
int | is_irq_entry () const |
Return whether the entry reason was an IRQ/IPC message. | |
l4_vcpu_regs_t * | r () throw () |
Return pointer to register state. | |
l4_vcpu_regs_t const * | r () const throw () |
Return pointer to register state. | |
l4_vcpu_ipc_regs_t * | i () throw () |
Return pointer to IPC state. | |
l4_vcpu_ipc_regs_t const * | i () const throw () |
Return pointer to IPC state. | |
void | entry_sp (l4_umword_t sp) |
Set vCPU entry stack pointer. | |
void | entry_ip (l4_umword_t ip) |
Set vCPU entry instruction pointer. | |
void | print_state (const char *prefix="") const throw () |
Print the state of the vCPU. | |
Static Public Member Functions | |
static int | ext_alloc (Vcpu **vcpu, l4_addr_t *ext_state, L4::Cap< L4::Task > task=L4Re::Env::env() ->task(), L4::Cap< L4Re::Rm > rm=L4Re::Env::env() ->rm()) throw () |
Allocate state area for an extended vCPU. | |
static Vcpu * | cast (void *x) throw () |
Cast a void pointer to a class pointer. | |
static Vcpu * | cast (l4_addr_t x) throw () |
Cast an address to a class pointer. | |
|
inlinestatic |
|
inline |
Set vCPU entry instruction pointer.
ip | Instruction pointer address to set. |
Definition at line 243 of file vcpu.
References l4_vcpu_state_t::entry_ip.
|
inline |
Set vCPU entry stack pointer.
sp | Stack pointer address to set. |
Definition at line 236 of file vcpu.
References l4_vcpu_state_t::entry_sp.
|
static |
Allocate state area for an extended vCPU.
[out] | vcpu | Allocated vcpu-state area. |
[out] | ext_state | Allocated extended vcpu-state area. |
task | Task to use for allocation, defaults to own task. | |
rm | Region manager to use for allocation defaults to standard region manager. |
References task().
|
inline |
Return pointer to IPC state.
Definition at line 220 of file vcpu.
References l4_vcpu_state_t::i.
|
inline |
Return pointer to IPC state.
Definition at line 227 of file vcpu.
References l4_vcpu_state_t::i.
|
inline |
Disable the vCPU for event delivery and return previous state.
Definition at line 89 of file vcpu.
References l4vcpu_irq_disable_save().
|
inline |
Enable the vCPU for event delivery.
utcb | The UTCB to use. |
do_event_work_cb | Call-back function that is called in case an event (such as an interrupt) is pending. |
setup_ipc | Call-back function that is called before an IPC operation is called, and before event delivery is enabled. |
Definition at line 146 of file vcpu.
References l4vcpu_irq_enable().
|
inline |
Restore a previously saved IRQ/event state.
s | IRQ state to be restored. |
utcb | The UTCB to use. |
do_event_work_cb | Call-back function that is called in case an event (such as an interrupt) is pending. |
setup_ipc | Call-back function that is called before an IPC operation is called, and before event delivery is enabled. |
Definition at line 161 of file vcpu.
References l4vcpu_irq_restore().
|
inline |
Return whether the entry reason was an IRQ/IPC message.
return 0 if not, !=0 otherwise.
Definition at line 199 of file vcpu.
References l4vcpu_is_irq_entry().
|
inline |
Return whether the entry reason was a page fault.
return 0 if not, !=0 otherwise.
Definition at line 192 of file vcpu.
References l4vcpu_is_page_fault_entry().
|
inline |
Return pointer to register state.
Definition at line 206 of file vcpu.
References l4_vcpu_state_t::r.
|
inline |
Return pointer to register state.
Definition at line 213 of file vcpu.
References l4_vcpu_state_t::r.
|
inline |
Get saved_state word.
Definition at line 117 of file vcpu.
References l4_vcpu_state_t::saved_state.
|
inline |
Get saved_state word.
Definition at line 127 of file vcpu.
References l4_vcpu_state_t::saved_state.
|
inline |
Get state word.
Definition at line 99 of file vcpu.
References l4_vcpu_state_t::state.
|
inline |
Get state word.
Definition at line 110 of file vcpu.
References l4_vcpu_state_t::state.
|
inline |
Set the task of the vCPU.
task | Task to set, defaults to invalid task. |
Definition at line 185 of file vcpu.
References task(), and l4_vcpu_state_t::user_task.
Referenced by ext_alloc(), and task().
|
inline |
Wait for event.
utcb | The UTCB to use. |
do_event_work_cb | Call-back function that is called in case an event (such as an interrupt) is pending. |
setup_ipc | Call-back function that is called before an IPC operation is called. |
Note that event delivery remains disabled after this function returns.
Definition at line 177 of file vcpu.
References l4vcpu_wait_for_event().