L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
vCPU Support Library

vCPU handling functionality. More...

+ Collaboration diagram for vCPU Support Library:

Modules

 Extended vCPU support
 Extended vCPU handling functionality.
 

Data Structures

class  L4vcpu::State
 C++ implementation of state word in the vCPU area. More...
 
class  L4vcpu::Vcpu
 C++ implementation of the vCPU save state area. More...
 

Functions

void l4vcpu_irq_disable (l4_vcpu_state_t *vcpu) L4_NOTHROW
 Disable a vCPU for event delivery.
 
unsigned l4vcpu_irq_disable_save (l4_vcpu_state_t *vcpu) L4_NOTHROW
 Disable a vCPU for event delivery and return previous state.
 
void l4vcpu_irq_enable (l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW
 Enable a vCPU for event delivery.
 
void l4vcpu_irq_restore (l4_vcpu_state_t *vcpu, unsigned s, l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW
 Restore a previously saved IRQ/event state.
 
void l4vcpu_wait_for_event (l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW
 Wait for event.
 
void l4vcpu_print_state (const l4_vcpu_state_t *vcpu, const char *prefix) L4_NOTHROW
 Print the state of a vCPU.
 
int l4vcpu_is_irq_entry (l4_vcpu_state_t const *vcpu) L4_NOTHROW
 Return whether the entry reason was an IRQ/IPC message.
 
int l4vcpu_is_page_fault_entry (l4_vcpu_state_t const *vcpu) L4_NOTHROW
 Return whether the entry reason was a page fault.
 

Detailed Description

vCPU handling functionality.

This library provides convenience functionality on top of the l4sys vCPU interface to ease programming. It wraps commonly used code and abstracts architecture depends parts as far as reasonable.

Function Documentation

◆ l4vcpu_irq_disable()

void l4vcpu_irq_disable ( l4_vcpu_state_t vcpu)
inline

Disable a vCPU for event delivery.

Parameters
vcpuPointer to vCPU area.

Definition at line 212 of file vcpu.h.

References l4_barrier().

Referenced by L4vcpu::Vcpu::irq_disable(), l4vcpu_irq_disable_save(), and l4vcpu_irq_restore().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4vcpu_irq_disable_save()

unsigned l4vcpu_irq_disable_save ( l4_vcpu_state_t vcpu)
inline

Disable a vCPU for event delivery and return previous state.

Parameters
vcpuPointer to vCPU area.
Returns
IRQ state before disabling IRQs.

Definition at line 220 of file vcpu.h.

References l4vcpu_irq_disable().

Referenced by L4vcpu::Vcpu::irq_disable_save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4vcpu_irq_enable()

void l4vcpu_irq_enable ( l4_vcpu_state_t vcpu,
l4_utcb_t utcb,
l4vcpu_event_hndl_t  do_event_work_cb,
l4vcpu_setup_ipc_t  setup_ipc 
)
inline

Enable a vCPU for event delivery.

Parameters
vcpuPointer to vCPU area.
utcbUtcb pointer of the calling vCPU.
do_event_work_cbCall-back function that is called in case an event (such as an interrupt) is pending.
setup_ipcFunction call-back that is called right before any IPC operation, and before event delivery is enabled.

Definition at line 243 of file vcpu.h.

References l4_barrier(), L4_IPC_BOTH_TIMEOUT_0, L4_LIKELY, L4_VCPU_F_IRQ, and L4_VCPU_SF_IRQ_PENDING.

Referenced by L4vcpu::Vcpu::irq_enable(), and l4vcpu_irq_restore().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4vcpu_irq_restore()

void l4vcpu_irq_restore ( l4_vcpu_state_t vcpu,
unsigned  s,
l4_utcb_t utcb,
l4vcpu_event_hndl_t  do_event_work_cb,
l4vcpu_setup_ipc_t  setup_ipc 
)
inline

Restore a previously saved IRQ/event state.

Parameters
vcpuPointer to vCPU area.
sIRQ state to be restored.
utcbUtcb pointer of the calling vCPU.
do_event_work_cbCall-back function that is called in case an event (such as an interrupt) is pending after enabling.
setup_ipcFunction call-back that is called right before any IPC operation, and before event delivery is enabled.

Definition at line 268 of file vcpu.h.

References L4_VCPU_F_IRQ, l4vcpu_irq_disable(), and l4vcpu_irq_enable().

Referenced by L4vcpu::Vcpu::irq_restore().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4vcpu_is_irq_entry()

int l4vcpu_is_irq_entry ( l4_vcpu_state_t const *  vcpu)
inline

Return whether the entry reason was an IRQ/IPC message.

Parameters
vcpuPointer to vCPU area.

return 0 if not, !=0 otherwise.

Referenced by L4vcpu::Vcpu::is_irq_entry().

+ Here is the caller graph for this function:

◆ l4vcpu_is_page_fault_entry()

int l4vcpu_is_page_fault_entry ( l4_vcpu_state_t const *  vcpu)
inline

Return whether the entry reason was a page fault.

Parameters
vcpuPointer to vCPU area.

return 0 if not, !=0 otherwise.

Referenced by L4vcpu::Vcpu::is_page_fault_entry().

+ Here is the caller graph for this function:

◆ l4vcpu_print_state()

void l4vcpu_print_state ( const l4_vcpu_state_t vcpu,
const char *  prefix 
)

Print the state of a vCPU.

Parameters
vcpuPointer to vCPU area.
prefixA prefix for each line printed.

Referenced by L4vcpu::Vcpu::print_state().

+ Here is the caller graph for this function:

◆ l4vcpu_wait_for_event()

void l4vcpu_wait_for_event ( l4_vcpu_state_t vcpu,
l4_utcb_t utcb,
l4vcpu_event_hndl_t  do_event_work_cb,
l4vcpu_setup_ipc_t  setup_ipc 
)
inline

Wait for event.

Parameters
vcpuPointer to vCPU area.
utcbUtcb pointer of the calling vCPU.
do_event_work_cbCall-back function that is called when the vCPU awakes and needs to handle an event/IRQ.
setup_ipcFunction call-back that is called right before any IPC operation.

Note that event delivery remains disabled after this function returns.

Definition at line 281 of file vcpu.h.

References L4_IPC_NEVER.

Referenced by L4vcpu::Vcpu::wait_for_event().

+ Here is the caller graph for this function: