23 #include <l4/vcpu/vcpu.h> 41 explicit State(
unsigned v) : _s(v) {}
48 void add(
unsigned bits)
throw() { _s |= bits; }
55 void clear(
unsigned bits)
throw() { _s &= ~bits; }
62 void set(
unsigned v)
throw() { _s = v; }
143 l4vcpu_setup_ipc_t setup_ipc)
throw()
158 l4vcpu_event_hndl_t do_event_work_cb,
159 l4vcpu_setup_ipc_t setup_ipc)
throw()
174 l4vcpu_setup_ipc_t setup_ipc)
throw()
182 { user_task = task.cap(); }
253 ext_alloc(
Vcpu **vcpu,
266 {
return reinterpret_cast<Vcpu *
>(x); }
276 {
return reinterpret_cast<Vcpu *
>(x); }
State saved_state() const
Get saved_state word.
unsigned short int l4_uint16_t
Unsigned 16bit value.
l4_vcpu_ipc_regs_t i
IPC state.
void l4vcpu_print_state(const l4_vcpu_state_t *vcpu, const char *prefix) L4_NOTHROW
Print the state of a vCPU.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
l4_uint16_t sticky_flags() const
Get sticky flags.
l4_vcpu_regs_t const * r() const
Return pointer to register state.
void l4vcpu_irq_disable(l4_vcpu_state_t *vcpu) L4_NOTHROW
Disable a vCPU for event delivery.
int is_irq_entry() const
Return whether the entry reason was an IRQ/IPC message.
State * saved_state()
Get saved_state word.
int l4vcpu_is_irq_entry(l4_vcpu_state_t const *vcpu) L4_NOTHROW
Return whether the entry reason was an IRQ/IPC message.
static Vcpu * cast(void *x)
Cast a void pointer to a class pointer.
void wait_for_event(l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc)
Wait for event.
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.
int is_page_fault_entry() const
Return whether the entry reason was a page fault.
State(unsigned v)
Initialize state.
unsigned irq_disable_save()
Disable the vCPU for event delivery and return previous state.
static Env const * env()
Returns the initial environment for the current task.
void entry_ip(l4_umword_t ip)
Set vCPU entry instruction pointer.
void task(L4::Cap< L4::Task > const task=L4::Cap< L4::Task >::Invalid)
Set the task of the vCPU.
unsigned long l4_umword_t
Unsigned machine word.
l4_umword_t entry_sp
Stack pointer for entry (when coming from user task)
l4_uint16_t state
Current vCPU state.
void print_state(const char *prefix="") const
Print the state of the vCPU.
#define L4_CV
Define calling convention.
l4_vcpu_regs_t r
Register state.
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 irq_restore(unsigned s, l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc)
Restore a previously saved IRQ/event state.
C++ implementation of the vCPU save state area.
State * state()
Get state word.
State state() const
Get state word.
l4_vcpu_ipc_regs_t const * i() const
Return pointer to IPC state.
l4_vcpu_ipc_regs_t * i()
Return pointer to IPC state.
void irq_disable()
Disable the vCPU for event delivery.
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.
C++ implementation of state word in the vCPU area.
static Vcpu * cast(l4_addr_t x)
Cast an address to a class pointer.
void irq_enable(l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, l4vcpu_setup_ipc_t setup_ipc)
Enable the vCPU for event delivery.
void add(unsigned bits)
Add flags.
l4_umword_t entry_ip
IP for entry.
C++ interface for capabilities.
unsigned long l4_addr_t
Address type.
l4_uint16_t saved_state
Saved vCPU state.
unsigned l4vcpu_irq_disable_save(l4_vcpu_state_t *vcpu) L4_NOTHROW
Disable a vCPU for event delivery and return previous state.
int l4vcpu_is_page_fault_entry(l4_vcpu_state_t const *vcpu) L4_NOTHROW
Return whether the entry reason was a page fault.
void entry_sp(l4_umword_t sp)
Set vCPU entry stack pointer.
l4_uint16_t sticky_flags
Pending flags.
void clear(unsigned bits)
Clear flags.
l4_vcpu_regs_t * r()
Return pointer to register state.