Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>,
* Björn Döbel <doebel@os.inf.tu-dresden.de>,
* Torsten Frenzel <frenzel@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/utcb.h>
#include <l4/sys/ipc.h>
L4_INLINE l4_msgtag_t
l4_thread_ex_regs(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp,
l4_umword_t flags) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_ex_regs_u(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp,
l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_ex_regs_ret(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp,
l4_umword_t *flags) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_ex_regs_ret_u(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp,
l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE void
l4_thread_control_start(void) L4_NOTHROW;
L4_INLINE void
l4_thread_control_start_u(l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE void
l4_thread_control_pager(l4_cap_idx_t pager) L4_NOTHROW;
L4_INLINE void
l4_thread_control_pager_u(l4_cap_idx_t pager, l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE void
l4_thread_control_exc_handler(l4_cap_idx_t exc_handler) L4_NOTHROW;
L4_INLINE void
l4_thread_control_exc_handler_u(l4_cap_idx_t exc_handler,
l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE void
l4_thread_control_bind(l4_utcb_t *thread_utcb,
l4_cap_idx_t task) L4_NOTHROW;
L4_INLINE void
l4_thread_control_bind_u(l4_utcb_t *thread_utcb,
l4_cap_idx_t task, l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE void
l4_thread_control_alien(int on) L4_NOTHROW;
L4_INLINE void
l4_thread_control_alien_u(l4_utcb_t *utcb, int on) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_control_commit(l4_cap_idx_t thread) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_control_commit_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_yield(void) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_switch(l4_cap_idx_t to_thread) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_switch_u(l4_cap_idx_t to_thread, l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_stats_time(l4_cap_idx_t thread, l4_kernel_clock_t *us) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_stats_time_u(l4_cap_idx_t thread, l4_kernel_clock_t *us,
l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_start(void) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_start_u(l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_commit(l4_cap_idx_t thread,
l4_msgtag_t tag) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_commit_u(l4_cap_idx_t thread,
l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control(l4_cap_idx_t thread, l4_addr_t vcpu_state) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control_u(l4_cap_idx_t thread, l4_addr_t vcpu_state,
l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control_ext(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control_ext_u(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state,
l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_register_del_irq(l4_cap_idx_t thread, l4_cap_idx_t irq) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_register_del_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
l4_utcb_t *utcb) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_start(void) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_start_u(l4_utcb_t *u) L4_NOTHROW;
L4_INLINE int
l4_thread_modify_sender_add(l4_umword_t match_mask,
l4_umword_t match,
l4_umword_t del_bits,
l4_umword_t add_bits,
l4_msgtag_t *tag) L4_NOTHROW;
L4_INLINE int
l4_thread_modify_sender_add_u(l4_umword_t match_mask,
l4_umword_t match,
l4_umword_t del_bits,
l4_umword_t add_bits,
l4_msgtag_t *tag, l4_utcb_t *u) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_commit(l4_cap_idx_t thread, l4_msgtag_t tag) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_commit_u(l4_cap_idx_t thread, l4_msgtag_t tag,
l4_utcb_t *u) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_register_doorbell_irq(l4_cap_idx_t thread,
l4_cap_idx_t irq) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_thread_register_doorbell_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
l4_utcb_t *u) L4_NOTHROW;
enum L4_thread_ops
{
L4_THREAD_CONTROL_OP = 0UL,
L4_THREAD_EX_REGS_OP = 1UL,
L4_THREAD_SWITCH_OP = 2UL,
L4_THREAD_STATS_OP = 3UL,
L4_THREAD_VCPU_RESUME_OP = 4UL,
L4_THREAD_REGISTER_DELETE_IRQ_OP = 5UL,
L4_THREAD_MODIFY_SENDER_OP = 6UL,
L4_THREAD_VCPU_CONTROL_OP = 7UL,
L4_THREAD_VCPU_CONTROL_EXT_OP = L4_THREAD_VCPU_CONTROL_OP | 0x10000,
L4_THREAD_REGISTER_DOORBELL_IRQ_OP = 8UL,
L4_THREAD_X86_GDT_OP = 0x10UL,
L4_THREAD_ARM_TPIDRURO_OP = 0x10UL,
L4_THREAD_AMD64_SET_SEGMENT_BASE_OP = 0x12UL,
L4_THREAD_AMD64_GET_SEGMENT_INFO_OP = 0x13UL,
L4_THREAD_OPCODE_MASK = 0xffff,
};
enum L4_thread_control_flags
{
L4_THREAD_CONTROL_SET_PAGER = 0x0010000,
L4_THREAD_CONTROL_BIND_TASK = 0x0200000,
L4_THREAD_CONTROL_ALIEN = 0x0400000,
L4_THREAD_CONTROL_SET_EXC_HANDLER = 0x1000000,
};
enum L4_thread_control_mr_indices
{
L4_THREAD_CONTROL_MR_IDX_FLAGS = 0,
L4_THREAD_CONTROL_MR_IDX_PAGER = 1,
L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER = 2,
L4_THREAD_CONTROL_MR_IDX_FLAG_VALS = 4,
L4_THREAD_CONTROL_MR_IDX_BIND_UTCB = 5,
L4_THREAD_CONTROL_MR_IDX_BIND_TASK = 6,
};
enum L4_thread_ex_regs_flags
{
L4_THREAD_EX_REGS_CANCEL = 0x10000UL,
L4_THREAD_EX_REGS_TRIGGER_EXCEPTION = 0x20000UL,
L4_THREAD_EX_REGS_ARCH_MASK = 0xff000000UL,
};
/* IMPLEMENTATION -----------------------------------------------------------*/
#include <l4/sys/ipc.h>
#include <l4/sys/types.h>
L4_INLINE l4_msgtag_t
l4_thread_ex_regs_u(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp,
l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[0] = L4_THREAD_EX_REGS_OP | flags;
v->mr[1] = ip;
v->mr[2] = sp;
return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 3, 0, 0), L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_ex_regs_ret_u(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp,
l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
l4_msgtag_t ret = l4_thread_ex_regs_u(thread, *ip, *sp, *flags, utcb);
if (l4_error_u(ret, utcb))
return ret;
*flags = v->mr[0];
*ip = v->mr[1];
*sp = v->mr[2];
return ret;
}
L4_INLINE void
l4_thread_control_start_u(l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] = L4_THREAD_CONTROL_OP;
}
L4_INLINE void
l4_thread_control_pager_u(l4_cap_idx_t pager, l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] |= L4_THREAD_CONTROL_SET_PAGER;
v->mr[L4_THREAD_CONTROL_MR_IDX_PAGER] = pager;
}
L4_INLINE void
l4_thread_control_exc_handler_u(l4_cap_idx_t exc_handler,
l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] |= L4_THREAD_CONTROL_SET_EXC_HANDLER;
v->mr[L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER] = exc_handler;
}
L4_INLINE void
l4_thread_control_bind_u(l4_utcb_t *thread_utcb, l4_cap_idx_t task,
l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] |= L4_THREAD_CONTROL_BIND_TASK;
v->mr[L4_THREAD_CONTROL_MR_IDX_BIND_UTCB] = (l4_addr_t)thread_utcb;
v->mr[L4_THREAD_CONTROL_MR_IDX_BIND_TASK] = L4_ITEM_MAP;
v->mr[L4_THREAD_CONTROL_MR_IDX_BIND_TASK + 1] = l4_obj_fpage(task, 0, L4_CAP_FPAGE_RWS).raw;
}
L4_INLINE void
l4_thread_control_alien_u(l4_utcb_t *utcb, int on) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] |= L4_THREAD_CONTROL_ALIEN;
v->mr[L4_THREAD_CONTROL_MR_IDX_FLAG_VALS] |= on ? L4_THREAD_CONTROL_ALIEN : 0;
}
L4_INLINE l4_msgtag_t
l4_thread_control_commit_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW
{
int items = 0;
if (l4_utcb_mr_u(utcb)->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] & L4_THREAD_CONTROL_BIND_TASK)
items = 1;
return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 6, items, 0), L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_yield(void) L4_NOTHROW
{
l4_ipc_receive(L4_INVALID_CAP, NULL, L4_IPC_BOTH_TIMEOUT_0);
return l4_msgtag(0, 0, 0, 0);
}
/* Preliminary, to be changed */
L4_INLINE l4_msgtag_t
l4_thread_switch_u(l4_cap_idx_t to_thread, l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[0] = L4_THREAD_SWITCH_OP;
return l4_ipc_call(to_thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0), L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_stats_time_u(l4_cap_idx_t thread, l4_kernel_clock_t *us,
l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
l4_msgtag_t res;
v->mr[0] = L4_THREAD_STATS_OP;
res = l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0), L4_IPC_NEVER);
if (l4_msgtag_has_error(res))
return res;
*us = v->mr64[l4_utcb_mr64_idx(0)];
return res;
}
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_start_u(l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[0] = L4_THREAD_VCPU_RESUME_OP;
return l4_msgtag(L4_PROTO_THREAD, 1, 0, 0);
}
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_commit_u(l4_cap_idx_t thread,
l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
{
return l4_ipc_call(thread, utcb, tag, L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_ex_regs(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp,
l4_umword_t flags) L4_NOTHROW
{
return l4_thread_ex_regs_u(thread, ip, sp, flags, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_ex_regs_ret(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp,
l4_umword_t *flags) L4_NOTHROW
{
return l4_thread_ex_regs_ret_u(thread, ip, sp, flags, l4_utcb());
}
L4_INLINE void
l4_thread_control_start(void) L4_NOTHROW
{
l4_thread_control_start_u(l4_utcb());
}
L4_INLINE void
l4_thread_control_pager(l4_cap_idx_t pager) L4_NOTHROW
{
l4_thread_control_pager_u(pager, l4_utcb());
}
L4_INLINE void
l4_thread_control_exc_handler(l4_cap_idx_t exc_handler) L4_NOTHROW
{
l4_thread_control_exc_handler_u(exc_handler, l4_utcb());
}
L4_INLINE void
l4_thread_control_bind(l4_utcb_t *thread_utcb, l4_cap_idx_t task) L4_NOTHROW
{
l4_thread_control_bind_u(thread_utcb, task, l4_utcb());
}
L4_INLINE void
l4_thread_control_alien(int on) L4_NOTHROW
{
l4_thread_control_alien_u(l4_utcb(), on);
}
L4_INLINE l4_msgtag_t
l4_thread_control_commit(l4_cap_idx_t thread) L4_NOTHROW
{
return l4_thread_control_commit_u(thread, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_switch(l4_cap_idx_t to_thread) L4_NOTHROW
{
return l4_thread_switch_u(to_thread, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_stats_time(l4_cap_idx_t thread, l4_kernel_clock_t *us) L4_NOTHROW
{
return l4_thread_stats_time_u(thread, us, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_start(void) L4_NOTHROW
{
return l4_thread_vcpu_resume_start_u(l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_vcpu_resume_commit(l4_cap_idx_t thread,
l4_msgtag_t tag) L4_NOTHROW
{
return l4_thread_vcpu_resume_commit_u(thread, tag, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_register_del_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
l4_utcb_t *u) L4_NOTHROW
{
l4_msg_regs_t *m = l4_utcb_mr_u(u);
m->mr[0] = L4_THREAD_REGISTER_DELETE_IRQ_OP;
m->mr[1] = l4_map_obj_control(0,0);
m->mr[2] = l4_obj_fpage(irq, 0, L4_CAP_FPAGE_RWS).raw;
return l4_ipc_call(thread, u, l4_msgtag(L4_PROTO_THREAD, 1, 1, 0), L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_register_del_irq(l4_cap_idx_t thread, l4_cap_idx_t irq) L4_NOTHROW
{
return l4_thread_register_del_irq_u(thread, irq, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control_u(l4_cap_idx_t thread, l4_addr_t vcpu_state,
l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[0] = L4_THREAD_VCPU_CONTROL_OP;
v->mr[1] = vcpu_state;
return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 2, 0, 0), L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control(l4_cap_idx_t thread, l4_addr_t vcpu_state) L4_NOTHROW
{ return l4_thread_vcpu_control_u(thread, vcpu_state, l4_utcb()); }
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control_ext_u(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state,
l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[0] = L4_THREAD_VCPU_CONTROL_EXT_OP;
v->mr[1] = ext_vcpu_state;
return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 2, 0, 0), L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_vcpu_control_ext(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state) L4_NOTHROW
{ return l4_thread_vcpu_control_ext_u(thread, ext_vcpu_state, l4_utcb()); }
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_start_u(l4_utcb_t *u) L4_NOTHROW
{
l4_msg_regs_t *m = l4_utcb_mr_u(u);
m->mr[0] = L4_THREAD_MODIFY_SENDER_OP;
return l4_msgtag(L4_PROTO_THREAD, 1, 0, 0);
}
L4_INLINE int
l4_thread_modify_sender_add_u(l4_umword_t match_mask,
l4_umword_t match,
l4_umword_t del_bits,
l4_umword_t add_bits,
l4_msgtag_t *tag, l4_utcb_t *u) L4_NOTHROW
{
l4_msg_regs_t *m = l4_utcb_mr_u(u);
unsigned w = l4_msgtag_words(*tag);
if (w >= L4_UTCB_GENERIC_DATA_SIZE - 4)
return -L4_ENOMEM;
m->mr[w] = match_mask;
m->mr[w+1] = match;
m->mr[w+2] = del_bits;
m->mr[w+3] = add_bits;
*tag = l4_msgtag(l4_msgtag_label(*tag), w + 4, 0, 0);
return 0;
}
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_commit_u(l4_cap_idx_t thread, l4_msgtag_t tag,
l4_utcb_t *u) L4_NOTHROW
{
return l4_ipc_call(thread, u, tag, L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_start(void) L4_NOTHROW
{
return l4_thread_modify_sender_start_u(l4_utcb());
}
L4_INLINE int
l4_thread_modify_sender_add(l4_umword_t match_mask,
l4_umword_t match,
l4_umword_t del_bits,
l4_umword_t add_bits,
l4_msgtag_t *tag) L4_NOTHROW
{
return l4_thread_modify_sender_add_u(match_mask, match,
del_bits, add_bits, tag, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_modify_sender_commit(l4_cap_idx_t thread, l4_msgtag_t tag) L4_NOTHROW
{
return l4_thread_modify_sender_commit_u(thread, tag, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_thread_register_doorbell_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
l4_utcb_t *u) L4_NOTHROW
{
l4_msg_regs_t *m = l4_utcb_mr_u(u);
m->mr[0] = L4_THREAD_REGISTER_DOORBELL_IRQ_OP;
m->mr[1] = l4_map_obj_control(0,0);
m->mr[2] = l4_obj_fpage(irq, 0, L4_CAP_FPAGE_RWS).raw;
return l4_ipc_call(thread, u, l4_msgtag(L4_PROTO_THREAD, 1, 1, 0),
L4_IPC_NEVER);
}
L4_INLINE l4_msgtag_t
l4_thread_register_doorbell_irq(l4_cap_idx_t thread,
l4_cap_idx_t irq) L4_NOTHROW
{
return l4_thread_register_doorbell_irq_u(thread, irq, l4_utcb());
}
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_addr_t
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
l4_kernel_clock_t
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Definition l4int.h:53
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
L4_INVALID_CAP
@ L4_INVALID_CAP
Invalid capability selector.
Definition consts.h:153
L4_ENOMEM
@ L4_ENOMEM
No memory.
Definition err.h:39
l4_obj_fpage
l4_fpage_t l4_obj_fpage(l4_cap_idx_t obj, unsigned int order, unsigned char rights) L4_NOTHROW
Create a kernel-object flexpage.
Definition __l4_fpage.h:715
L4_CAP_FPAGE_RWS
@ L4_CAP_FPAGE_RWS
Read, interface specific 'W', and 'S' rights for capability flexpages.
Definition __l4_fpage.h:206
l4_ipc_receive
l4_msgtag_t l4_ipc_receive(l4_cap_idx_t object, l4_utcb_t *utcb, l4_timeout_t timeout) L4_NOTHROW
Wait for a message from a specific source.
Definition ipc.h:602
l4_ipc_call
l4_msgtag_t l4_ipc_call(l4_cap_idx_t object, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Object call (usual invocation).
Definition ipc.h:565
l4_map_obj_control
l4_umword_t l4_map_obj_control(l4_umword_t spot, unsigned grant) L4_NOTHROW
Create the first word for a map item that is a send item for the object space.
Definition __l4_fpage.h:749
L4_ITEM_MAP
@ L4_ITEM_MAP
Identify a message item as map item.
Definition consts.h:214
l4_msgtag_has_error
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition types.h:440
l4_msgtag
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
Definition types.h:405
l4_msgtag_words
unsigned l4_msgtag_words(l4_msgtag_t t) L4_NOTHROW
Get the number of untyped words.
Definition types.h:427
l4_msgtag_label
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
Definition types.h:417
L4_PROTO_THREAD
@ L4_PROTO_THREAD
Protocol for messages to a thread object.
Definition types.h:54
L4_thread_ops
L4_thread_ops
Operations on thread objects.
Definition thread.h:733
L4_THREAD_OPCODE_MASK
@ L4_THREAD_OPCODE_MASK
Mask for opcodes.
Definition thread.h:748
L4_THREAD_AMD64_GET_SEGMENT_INFO_OP
@ L4_THREAD_AMD64_GET_SEGMENT_INFO_OP
Get segment information.
Definition thread.h:747
L4_THREAD_REGISTER_DOORBELL_IRQ_OP
@ L4_THREAD_REGISTER_DOORBELL_IRQ_OP
Register direct IRQ injection doorbell IRQ.
Definition thread.h:743
L4_THREAD_AMD64_SET_SEGMENT_BASE_OP
@ L4_THREAD_AMD64_SET_SEGMENT_BASE_OP
Set segment base.
Definition thread.h:746
L4_THREAD_X86_GDT_OP
@ L4_THREAD_X86_GDT_OP
Gdt.
Definition thread.h:744
L4_THREAD_EX_REGS_OP
@ L4_THREAD_EX_REGS_OP
Exchange registers operation.
Definition thread.h:735
L4_THREAD_STATS_OP
@ L4_THREAD_STATS_OP
Thread statistics.
Definition thread.h:737
L4_THREAD_VCPU_CONTROL_OP
@ L4_THREAD_VCPU_CONTROL_OP
Enable / disable VCPU feature.
Definition thread.h:741
L4_THREAD_MODIFY_SENDER_OP
@ L4_THREAD_MODIFY_SENDER_OP
Modify all senders IDs that match the given pattern.
Definition thread.h:740
L4_THREAD_CONTROL_OP
@ L4_THREAD_CONTROL_OP
Control operation.
Definition thread.h:734
L4_THREAD_ARM_TPIDRURO_OP
@ L4_THREAD_ARM_TPIDRURO_OP
Set TPIDRURO register.
Definition thread.h:745
L4_THREAD_VCPU_RESUME_OP
@ L4_THREAD_VCPU_RESUME_OP
VCPU resume.
Definition thread.h:738
L4_THREAD_REGISTER_DELETE_IRQ_OP
@ L4_THREAD_REGISTER_DELETE_IRQ_OP
Register an IPC-gate deletion IRQ.
Definition thread.h:739
L4_THREAD_SWITCH_OP
@ L4_THREAD_SWITCH_OP
Do a thread switch.
Definition thread.h:736
l4_thread_modify_sender_start
l4_msgtag_t l4_thread_modify_sender_start(void) L4_NOTHROW
Start a thread sender modification sequence.
Definition thread.h:1110
l4_thread_vcpu_control_ext_u
l4_msgtag_t l4_thread_vcpu_control_ext_u(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state, l4_utcb_t *utcb) L4_NOTHROW
Enable the extended vCPU feature for the thread.
Definition thread.h:1059
l4_thread_ex_regs
l4_msgtag_t l4_thread_ex_regs(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp, l4_umword_t flags) L4_NOTHROW
Exchange basic thread registers.
Definition thread.h:942
L4_thread_ex_regs_flags
L4_thread_ex_regs_flags
Flags for the thread ex-regs operation.
Definition thread.h:798
l4_thread_modify_sender_add
int l4_thread_modify_sender_add(l4_umword_t match_mask, l4_umword_t match, l4_umword_t del_bits, l4_umword_t add_bits, l4_msgtag_t *tag) L4_NOTHROW
Add a modification pattern to a sender modification sequence.
Definition thread.h:1116
l4_thread_vcpu_control_ext
l4_msgtag_t l4_thread_vcpu_control_ext(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state) L4_NOTHROW
Enable the extended vCPU feature for the thread.
Definition thread.h:1069
l4_thread_ex_regs_ret_u
l4_msgtag_t l4_thread_ex_regs_ret_u(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp, l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW
Exchange basic thread registers and return previous values.
Definition thread.h:823
l4_thread_yield
l4_msgtag_t l4_thread_yield(void) L4_NOTHROW
Yield current time slice.
Definition thread.h:891
l4_thread_vcpu_resume_start
l4_msgtag_t l4_thread_vcpu_resume_start(void) L4_NOTHROW
vCPU return from event handler.
Definition thread.h:1011
L4_thread_control_flags
L4_thread_control_flags
Flags for the thread control operation.
Definition thread.h:762
l4_thread_ex_regs_ret
l4_msgtag_t l4_thread_ex_regs_ret(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp, l4_umword_t *flags) L4_NOTHROW
Exchange basic thread registers and return previous values.
Definition thread.h:949
l4_thread_stats_time
l4_msgtag_t l4_thread_stats_time(l4_cap_idx_t thread, l4_kernel_clock_t *us) L4_NOTHROW
Get consumed time of thread in µs.
Definition thread.h:1005
l4_thread_vcpu_control_u
l4_msgtag_t l4_thread_vcpu_control_u(l4_cap_idx_t thread, l4_addr_t vcpu_state, l4_utcb_t *utcb) L4_NOTHROW
Enable the vCPU feature for the thread.
Definition thread.h:1044
l4_thread_ex_regs_u
l4_msgtag_t l4_thread_ex_regs_u(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp, l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW
Exchange basic thread registers.
Definition thread.h:812
l4_thread_register_del_irq
l4_msgtag_t l4_thread_register_del_irq(l4_cap_idx_t thread, l4_cap_idx_t irq) L4_NOTHROW
Register an IRQ that will trigger upon deletion events.
Definition thread.h:1037
l4_thread_vcpu_resume_commit
l4_msgtag_t l4_thread_vcpu_resume_commit(l4_cap_idx_t thread, l4_msgtag_t tag) L4_NOTHROW
Commit vCPU resume.
Definition thread.h:1017
l4_thread_modify_sender_commit
l4_msgtag_t l4_thread_modify_sender_commit(l4_cap_idx_t thread, l4_msgtag_t tag) L4_NOTHROW
Apply (commit) a sender modification sequence.
Definition thread.h:1127
l4_thread_register_doorbell_irq
l4_msgtag_t l4_thread_register_doorbell_irq(l4_cap_idx_t thread, l4_cap_idx_t irq) L4_NOTHROW
Register an IRQ that will trigger when a forwarded virtual interrupt is pending.
Definition thread.h:1146
l4_thread_switch
l4_msgtag_t l4_thread_switch(l4_cap_idx_t to_thread) L4_NOTHROW
Switch to another thread (and donate the remaining time slice).
Definition thread.h:996
l4_thread_vcpu_control
l4_msgtag_t l4_thread_vcpu_control(l4_cap_idx_t thread, l4_addr_t vcpu_state) L4_NOTHROW
Enable the vCPU feature for the thread.
Definition thread.h:1054
L4_thread_control_mr_indices
L4_thread_control_mr_indices
Indices for the values in the message register for thread control.
Definition thread.h:783
L4_THREAD_EX_REGS_CANCEL
@ L4_THREAD_EX_REGS_CANCEL
Cancel ongoing IPC in the thread.
Definition thread.h:799
L4_THREAD_EX_REGS_ARCH_MASK
@ L4_THREAD_EX_REGS_ARCH_MASK
Arch specific flags.
Definition thread.h:802
L4_THREAD_EX_REGS_TRIGGER_EXCEPTION
@ L4_THREAD_EX_REGS_TRIGGER_EXCEPTION
Trigger artificial exception in thread.
Definition thread.h:800
L4_THREAD_CONTROL_SET_PAGER
@ L4_THREAD_CONTROL_SET_PAGER
The pager will be given.
Definition thread.h:764
L4_THREAD_CONTROL_BIND_TASK
@ L4_THREAD_CONTROL_BIND_TASK
The task to bind the thread to will be given.
Definition thread.h:766
L4_THREAD_CONTROL_ALIEN
@ L4_THREAD_CONTROL_ALIEN
Alien state of the thread is set.
Definition thread.h:768
L4_THREAD_CONTROL_SET_EXC_HANDLER
@ L4_THREAD_CONTROL_SET_EXC_HANDLER
The exception handler of the thread will be given.
Definition thread.h:770
L4_THREAD_CONTROL_MR_IDX_FLAG_VALS
@ L4_THREAD_CONTROL_MR_IDX_FLAG_VALS
Index for feature values.
Definition thread.h:787
L4_THREAD_CONTROL_MR_IDX_PAGER
@ L4_THREAD_CONTROL_MR_IDX_PAGER
Index for pager cap.
Definition thread.h:785
L4_THREAD_CONTROL_MR_IDX_BIND_TASK
@ L4_THREAD_CONTROL_MR_IDX_BIND_TASK
Index for task flexpage for bind.
Definition thread.h:789
L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER
@ L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER
Index for exception handler.
Definition thread.h:786
L4_THREAD_CONTROL_MR_IDX_FLAGS
@ L4_THREAD_CONTROL_MR_IDX_FLAGS
Definition thread.h:784
L4_THREAD_CONTROL_MR_IDX_BIND_UTCB
@ L4_THREAD_CONTROL_MR_IDX_BIND_UTCB
Index for UTCB address for bind.
Definition thread.h:788
l4_thread_control_bind
void l4_thread_control_bind(l4_utcb_t *thread_utcb, l4_cap_idx_t task) L4_NOTHROW
Bind the thread to a task.
Definition thread.h:975
l4_thread_control_commit
l4_msgtag_t l4_thread_control_commit(l4_cap_idx_t thread) L4_NOTHROW
Commit the thread control parameters.
Definition thread.h:987
l4_thread_control_alien
void l4_thread_control_alien(int on) L4_NOTHROW
Enable alien mode.
Definition thread.h:981
l4_thread_control_exc_handler
void l4_thread_control_exc_handler(l4_cap_idx_t exc_handler) L4_NOTHROW
Set the exception handler.
Definition thread.h:968
l4_thread_control_start
void l4_thread_control_start(void) L4_NOTHROW
Start a thread control API sequence.
Definition thread.h:956
l4_thread_control_pager
void l4_thread_control_pager(l4_cap_idx_t pager) L4_NOTHROW
Set the pager.
Definition thread.h:962
l4_utcb_mr64_idx
unsigned l4_utcb_mr64_idx(unsigned idx) L4_NOTHROW
Get index into 64bit message registers alias from native-sized index.
Definition utcb.h:392
L4_IPC_BOTH_TIMEOUT_0
#define L4_IPC_BOTH_TIMEOUT_0
0 receive and send timeout
Definition __timeout.h:79
L4_IPC_NEVER
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:76
l4_utcb_t
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
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
ipc.h
Common IPC interface.
types.h
Common L4 ABI Data Types.
utcb.h
UTCB definitions.
l4_msgtag_t
Message tag data structure.
Definition types.h:154
l4_fpage_t::raw
l4_umword_t raw
Raw value.
Definition __l4_fpage.h:78
l4_msg_regs_t
Encapsulation of the message-register block in the UTCB.
Definition utcb.h:68
l4_msg_regs_t::mr
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:69
l4_msg_regs_t::mr64
l4_uint64_t mr64[L4_UTCB_GENERIC_DATA_SIZE/(sizeof(l4_uint64_t)/sizeof(l4_umword_t))]
Message registers 64bit alias.
Definition utcb.h:70