Loading...
Searching...
No Matches
vcpu.h
Go to the documentation of this file.
/*
* (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/types.h>
#include <l4/sys/__vcpu-arch.h>
typedef struct l4_vcpu_state_t
{
l4_umword_t version;
l4_umword_t user_data[7];
l4_vcpu_regs_t r;
l4_vcpu_ipc_regs_t i;
l4_uint16_t state;
l4_uint16_t saved_state;
l4_uint16_t sticky_flags;
l4_uint16_t _reserved;
l4_cap_idx_t user_task;
l4_umword_t entry_sp;
l4_umword_t entry_ip;
l4_umword_t reserved_sp;
l4_vcpu_arch_state_t arch_state;
} l4_vcpu_state_t;
enum L4_vcpu_state_flags
{
L4_VCPU_F_IRQ = 0x01,
L4_VCPU_F_PAGE_FAULTS = 0x02,
L4_VCPU_F_EXCEPTIONS = 0x04,
L4_VCPU_F_USER_MODE = 0x20,
L4_VCPU_F_FPU_ENABLED = 0x80,
};
enum L4_vcpu_sticky_flags
{
L4_VCPU_SF_IRQ_PENDING = 0x01,
};
L4_INLINE int
l4_vcpu_check_version(l4_vcpu_state_t const *vcpu) L4_NOTHROW;
/* IMPLEMENTATION: ------------------------------------------------*/
L4_INLINE int
l4_vcpu_check_version(l4_vcpu_state_t const *vcpu) L4_NOTHROW
{
return vcpu->version == L4_VCPU_STATE_VERSION;
}
L4_VCPU_STATE_VERSION
@ L4_VCPU_STATE_VERSION
Architecture-specific version ID.
Definition __vcpu-arch.h:25
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_uint16_t
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition l4int.h:27
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
L4_vcpu_sticky_flags
L4_vcpu_sticky_flags
Sticky flags of a vCPU.
Definition vcpu.h:168
L4_vcpu_state_flags
L4_vcpu_state_flags
State flags of a vCPU.
Definition vcpu.h:102
L4_VCPU_SF_IRQ_PENDING
@ L4_VCPU_SF_IRQ_PENDING
An event is pending: Either an IRQ or another thread attempts to send an IPC to this vCPU thread.
Definition vcpu.h:171
L4_VCPU_F_USER_MODE
@ L4_VCPU_F_USER_MODE
User task will be used.
Definition vcpu.h:152
L4_VCPU_F_EXCEPTIONS
@ L4_VCPU_F_EXCEPTIONS
Exceptions enabled.
Definition vcpu.h:142
L4_VCPU_F_IRQ
@ L4_VCPU_F_IRQ
Receiving of IRQs and IPC enabled.
Definition vcpu.h:114
L4_VCPU_F_FPU_ENABLED
@ L4_VCPU_F_FPU_ENABLED
FPU enabled.
Definition vcpu.h:160
L4_VCPU_F_PAGE_FAULTS
@ L4_VCPU_F_PAGE_FAULTS
Page faults enabled.
Definition vcpu.h:129
L4_NOTHROW
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
L4_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
types.h
Common L4 ABI Data Types.
l4_vcpu_arch_state_t
Architecture-specific vCPU state.
Definition __vcpu-arch.h:75
l4_vcpu_ipc_regs_t
vCPU message registers.
Definition __vcpu-arch.h:84
l4_vcpu_regs_t
vCPU registers.
Definition __vcpu-arch.h:56
l4_vcpu_state_t
State of a vCPU.
Definition vcpu.h:76
l4_vcpu_state_t::entry_sp
l4_umword_t entry_sp
Stack pointer for entry (when coming from user task).
Definition vcpu.h:91
l4_vcpu_state_t::arch_state
l4_vcpu_arch_state_t arch_state
Architecture-specific state.
Definition vcpu.h:94
l4_vcpu_state_t::sticky_flags
l4_uint16_t sticky_flags
Pending flags. See L4_vcpu_sticky_flags.
Definition vcpu.h:86
l4_vcpu_state_t::state
l4_uint16_t state
Current vCPU state. See L4_vcpu_state_flags.
Definition vcpu.h:84
l4_vcpu_state_t::r
l4_vcpu_regs_t r
Register state.
Definition vcpu.h:81
l4_vcpu_state_t::version
l4_umword_t version
vCPU ABI version.
Definition vcpu.h:77
l4_vcpu_state_t::entry_ip
l4_umword_t entry_ip
IP for entry.
Definition vcpu.h:92
l4_vcpu_state_t::user_task
l4_cap_idx_t user_task
User task to use.
Definition vcpu.h:89
l4_vcpu_state_t::user_data
l4_umword_t user_data[7]
User-specific data.
Definition vcpu.h:80
l4_vcpu_state_t::i
l4_vcpu_ipc_regs_t i
IPC state.
Definition vcpu.h:82
l4_vcpu_state_t::saved_state
l4_uint16_t saved_state
Saved vCPU state. See L4_vcpu_state_flags.
Definition vcpu.h:85
l4_vcpu_check_version
int l4_vcpu_check_version(l4_vcpu_state_t const *vcpu) L4_NOTHROW
Check if a vCPU state has the right version.
Definition vcpu.h:191