L4Re - L4 Runtime Environment
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L4vcpu::Vcpu Class Reference

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.
Statestate () throw ()
 Get state word.
State state () const throw ()
 Get state word.
Statesaved_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_tr () throw ()
 Return pointer to register state.
l4_vcpu_regs_t const * r () const throw ()
 Return pointer to register state.
l4_vcpu_ipc_regs_ti () 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 Vcpucast (void *x) throw ()
 Cast a void pointer to a class pointer.
static Vcpucast (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.

Detailed Description

C++ implementation of the vCPU save state area.

Definition at line 72 of file vcpu.

Member Function Documentation

Irq_state L4vcpu::Vcpu::irq_disable_save ( ) throw ()
inline

Disable the vCPU for event delivery and return previous state.

Returns
IRQ state before disabling IRQs.

Definition at line 90 of file vcpu.

References l4vcpu_irq_disable_save().

+ Here is the call graph for this function:

State* L4vcpu::Vcpu::state ( ) throw ()
inline

Get state word.

Returns
Pointer to state word in the vCPU

Definition at line 97 of file vcpu.

Referenced by state().

+ Here is the caller graph for this function:

State L4vcpu::Vcpu::state ( ) const throw ()
inline

Get state word.

Returns
Pointer to state word in the vCPU

Definition at line 104 of file vcpu.

References state().

+ Here is the call graph for this function:

State* L4vcpu::Vcpu::saved_state ( ) throw ()
inline

Get saved_state word.

Returns
Pointer to saved_state word in the vCPU

Definition at line 111 of file vcpu.

Referenced by saved_state().

+ Here is the caller graph for this function:

State L4vcpu::Vcpu::saved_state ( ) const throw ()
inline

Get saved_state word.

Returns
Pointer to saved_state word in the vCPU

Definition at line 118 of file vcpu.

References saved_state().

+ Here is the call graph for this function:

void L4vcpu::Vcpu::irq_enable ( l4_utcb_t utcb,
l4vcpu_event_hndl_t  do_event_work_cb,
l4vcpu_setup_ipc_t  setup_ipc 
) throw ()
inline

Enable the vCPU for event delivery.

Parameters
utcbThe UTCB to use.
do_event_work_cbCall-back function that is called in case an event (such as an interrupt) is pending.
setup_ipcCall-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:

void L4vcpu::Vcpu::irq_restore ( Irq_state  s,
l4_utcb_t utcb,
l4vcpu_event_hndl_t  do_event_work_cb,
l4vcpu_setup_ipc_t  setup_ipc 
) throw ()
inline

Restore a previously saved IRQ/event state.

Parameters
sIRQ state to be restored.
utcbThe UTCB to use.
do_event_work_cbCall-back function that is called in case an event (such as an interrupt) is pending.
setup_ipcCall-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:

void L4vcpu::Vcpu::wait_for_event ( l4_utcb_t utcb,
l4vcpu_event_hndl_t  do_event_work_cb,
l4vcpu_setup_ipc_t  setup_ipc 
) throw ()
inline

Wait for event.

Parameters
utcbThe UTCB to use.
do_event_work_cbCall-back function that is called in case an event (such as an interrupt) is pending.
setup_ipcCall-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:

void L4vcpu::Vcpu::task ( L4::Cap< L4::Task > const  task = L4::Cap<L4::Task>::Invalid) throw ()
inline

Set the task of the vCPU.

Parameters
taskTask to set, defaults to invalid task.

Definition at line 168 of file vcpu.

References l4_vcpu_state_t::user_task.

int L4vcpu::Vcpu::is_page_fault_entry ( )
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:

int L4vcpu::Vcpu::is_irq_entry ( )
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:

l4_vcpu_regs_t* L4vcpu::Vcpu::r ( ) throw ()
inline

Return pointer to register state.

Returns
Pointer to register state.

Definition at line 189 of file vcpu.

Referenced by r().

+ Here is the caller graph for this function:

l4_vcpu_regs_t const* L4vcpu::Vcpu::r ( ) const throw ()
inline

Return pointer to register state.

Returns
Pointer to register state.

Definition at line 196 of file vcpu.

References r().

+ Here is the call graph for this function:

l4_vcpu_ipc_regs_t* L4vcpu::Vcpu::i ( ) throw ()
inline

Return pointer to IPC state.

Returns
Pointer to IPC state.

Definition at line 203 of file vcpu.

Referenced by i().

+ Here is the caller graph for this function:

l4_vcpu_ipc_regs_t const* L4vcpu::Vcpu::i ( ) const throw ()
inline

Return pointer to IPC state.

Returns
Pointer to IPC state.

Definition at line 210 of file vcpu.

References i().

+ Here is the call graph for this function:

void L4vcpu::Vcpu::entry_sp ( l4_umword_t  sp)
inline

Set vCPU entry stack pointer.

Parameters
spStack pointer address to set.
Note
The value is only used when entering from a user-task.

Definition at line 219 of file vcpu.

References l4_vcpu_state_t::entry_sp.

void L4vcpu::Vcpu::entry_ip ( l4_umword_t  ip)
inline

Set vCPU entry instruction pointer.

Parameters
ipInstruction pointer address to set.

Definition at line 226 of file vcpu.

References l4_vcpu_state_t::entry_ip.

static int L4vcpu::Vcpu::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 ()
static

Allocate state area for an extended vCPU.

Return values
vcpuAllocated vcpu-state area.
ext_stateAllocated extended vcpu-state area.
Parameters
taskTask to use for allocation, defaults to own task.
rmRegion manager to use for allocation defaults to standard region manager.
Returns
0 for success, error code otherwise
static Vcpu* L4vcpu::Vcpu::cast ( void *  x) throw ()
inlinestatic

Cast a void pointer to a class pointer.

Parameters
xPointer.
Returns
Pointer to Vcpu class.

Definition at line 252 of file vcpu.

static Vcpu* L4vcpu::Vcpu::cast ( l4_addr_t  x) throw ()
inlinestatic

Cast an address to a class pointer.

Parameters
xPointer.
Returns
Pointer to Vcpu class.

Definition at line 262 of file vcpu.


The documentation for this class was generated from the following file:
L4Re - L4 Runtime Environment