C++ implementation of the vCPU save state area. More...
Inheritance diagram for L4vcpu::Vcpu:
Collaboration diagram for L4vcpu::Vcpu:Public Types | |
| typedef l4vcpu_irq_state_t | Irq_state |
| IRQ status type. | |
Public Member Functions | |
| void | irq_disable () throw () |
| Disable the vCPU for event delivery. | |
| Irq_state | 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. | |
| 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 (Irq_state 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 () |
| Return whether the entry reason was a page fault. | |
| int | is_irq_entry () |
| 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="") 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. | |
Additional Inherited Members | |
Private Attributes inherited from l4_vcpu_state_t | |
| l4_vcpu_regs_t | r |
| Register state. | |
| l4_vcpu_ipc_regs_t | i |
| IPC state. | |
| l4_uint16_t | state |
| Current vCPU state. | |
| l4_uint16_t | saved_state |
| Saved vCPU state. | |
| l4_uint16_t | sticky_flags |
| Pending flags. | |
| l4_cap_idx_t | user_task |
| User task to use. | |
| l4_umword_t | entry_sp |
| Stack pointer for entry (when coming from user task) | |
| l4_umword_t | entry_ip |
| IP for entry. | |
|
inline |
Disable the vCPU for event delivery and return previous state.
Definition at line 90 of file vcpu.
References l4vcpu_irq_disable_save().
Here is the call graph for this function:
|
inline |
|
inline |
|
inline |
Get saved_state word.
Definition at line 111 of file vcpu.
Referenced by saved_state().
Here is the caller graph for this function:
|
inline |
Get saved_state word.
Definition at line 118 of file vcpu.
References saved_state().
Here is the call graph for this function:
|
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. |
Definition at line 130 of file vcpu.
References l4vcpu_irq_enable().
Here is the call graph for this function:
|
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. |
Definition at line 144 of file vcpu.
References l4vcpu_irq_restore().
Here is the call graph for this function:
|
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 160 of file vcpu.
References l4vcpu_wait_for_event().
Here is the call graph for this function:
|
inline |
Set the task of the vCPU.
| task | Task to set, defaults to invalid task. |
Definition at line 168 of file vcpu.
References l4_vcpu_state_t::user_task.
|
inline |
Return whether the entry reason was a page fault.
return 0 if not, !=0 otherwise.
Definition at line 175 of file vcpu.
References l4vcpu_is_page_fault_entry().
Here is the call graph for this function:
|
inline |
Return whether the entry reason was an IRQ/IPC message.
return 0 if not, !=0 otherwise.
Definition at line 182 of file vcpu.
References l4vcpu_is_irq_entry().
Here is the call graph for this function:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set vCPU entry stack pointer.
| sp | Stack pointer address to set. |
Definition at line 219 of file vcpu.
References l4_vcpu_state_t::entry_sp.
|
inline |
Set vCPU entry instruction pointer.
| ip | Instruction pointer address to set. |
Definition at line 226 of file vcpu.
References l4_vcpu_state_t::entry_ip.
|
static |
Allocate state area for an extended vCPU.
| vcpu | Allocated vcpu-state area. |
| 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. |
|
inlinestatic |