Loading...
Searching...
No Matches
vCPU Support Library

vCPU handling functionality. More...

Collaboration diagram for vCPU Support Library:

## Topics

| 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

  vcpu | Pointer to vCPU area.

Definition at line 201 of file vcpu.h.

References l4_barrier(), L4_NOTHROW, and L4_VCPU_F_IRQ.

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

  vcpu | Pointer to vCPU area.

Returns
  IRQ state before disabling IRQs.

Definition at line 209 of file vcpu.h.

References L4_NOTHROW, and 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

  vcpu | Pointer to vCPU area.
  utcb | Utcb pointer of the calling vCPU.
  do_event_work_cb | Call-back function that is called in case an event (such as an interrupt) is pending.
  setup_ipc | Function call-back that is called right before any IPC operation, and before event delivery is enabled.

Definition at line 232 of file vcpu.h.

References l4_barrier(), L4_IPC_BOTH_TIMEOUT_0, L4_LIKELY, L4_NOTHROW, 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

  vcpu | Pointer to vCPU area.
  s | IRQ state to be restored.
  utcb | Utcb pointer of the calling vCPU.
  do_event_work_cb | Call-back function that is called in case an event (such as an interrupt) is pending after enabling.
  setup_ipc | Function call-back that is called right before any IPC operation, and before event delivery is enabled.

Definition at line 257 of file vcpu.h.

References L4_NOTHROW, 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

  vcpu | Pointer to vCPU area.

return 0 if not, !=0 otherwise.

References L4_CV, L4_INLINE, and L4_NOTHROW.

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

  vcpu | Pointer to vCPU area.

return 0 if not, !=0 otherwise.

References L4_CV, and L4_NOTHROW.

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

  vcpu | Pointer to vCPU area.
  prefix | A prefix for each line printed.

References L4_CV, L4_INLINE, and L4_NOTHROW.

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

  vcpu | Pointer to vCPU area.
  utcb | Utcb pointer of the calling vCPU.
  do_event_work_cb | Call-back function that is called when the vCPU awakes and needs to handle an event/IRQ.
  setup_ipc | Function call-back that is called right before any IPC operation.

Note that event delivery remains disabled after this function returns.

Definition at line 270 of file vcpu.h.

References L4_IPC_NEVER, and L4_NOTHROW.

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

Here is the caller graph for this function: