26#ifndef __L4SYS__INCLUDE__L4API_FIASCO__IPC_H__
27#define __L4SYS__INCLUDE__L4API_FIASCO__IPC_H__
30#include <l4/sys/utcb.h>
564l4_sndfpage_add_u(
l4_fpage_t const snd_fpage,
unsigned long snd_base,
636 l4_timeout_from_us(us)));
659 return l4_error_u(tag,
l4_utcb());
664{
return (l4_utcb_tcr_u(u)->error & 1) == 0; }
667{
return l4_utcb_tcr_u(u)->
error & 1; }
678l4_sndfpage_add_u(
l4_fpage_t const snd_fpage,
unsigned long snd_base,
684 if (i >= L4_UTCB_GENERIC_DATA_SIZE - 1)
688 v->
mr[i + 1] = snd_fpage.raw;
699 return l4_sndfpage_add_u(snd_fpage, snd_base, tag,
l4_utcb());
unsigned long l4_umword_t
Unsigned machine word.
unsigned int l4_uint32_t
Unsigned 32bit value.
unsigned long long l4_uint64_t
Unsigned 64bit value.
unsigned long l4_cap_idx_t
Capability selector type.
@ L4_INVALID_CAP
Invalid capability selector.
@ L4_EIPC_LO
Communication error-range low.
l4_msgtag_t l4_ipc_reply_and_wait(l4_utcb_t *utcb, l4_msgtag_t tag, l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW
Reply and wait operation (uses the reply capability).
l4_msgtag_t l4_ipc(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_umword_t flags, l4_umword_t slabel, l4_msgtag_t tag, l4_umword_t *rlabel, l4_timeout_t timeout) L4_NOTHROW
Generic L4 object invocation.
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.
l4_msgtag_t l4_ipc_sleep_us(l4_uint64_t us) L4_NOTHROW
Sleep for a certain amount of microseconds.
l4_msgtag_t l4_ipc_send_and_wait(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_msgtag_t tag, l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW
Send a message and do an open wait.
l4_msgtag_t l4_ipc_send(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Send a message to an object (do not wait for a reply).
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).
l4_msgtag_t l4_ipc_sleep(l4_timeout_t timeout) L4_NOTHROW
Sleep for an amount of time.
int l4_sndfpage_add(l4_fpage_t const snd_fpage, unsigned long snd_base, l4_msgtag_t *tag) L4_NOTHROW
Add a flex-page to be sent to the UTCB.
l4_msgtag_t l4_ipc_wait(l4_utcb_t *utcb, l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW
Wait for an incoming message from any possible sender.
l4_msgtag_t l4_ipc_sleep_ms(l4_uint32_t ms) L4_NOTHROW
Sleep for a certain amount of milliseconds.
@ L4_SYSF_SEND_AND_WAIT
Send-and-wait flags.
@ L4_SYSF_WAIT
Wait flags (combines receive and open wait).
@ L4_SYSF_CALL
Call flags (combines send and receive).
@ L4_SYSF_SEND
Send-phase flag.
@ L4_SYSF_REPLY_AND_WAIT
Reply-and-wait flags.
@ L4_SYSF_RECV
Receive-phase flag.
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Get IPC error code if any or message tag label otherwise for an IPC call.
int l4_ipc_is_snd_error(l4_utcb_t *utcb) L4_NOTHROW
Returns whether an error occurred in send phase of an invocation.
int l4_ipc_error_code(l4_utcb_t *utcb) L4_NOTHROW
Get the error condition of the last invocation from the TCR.
l4_ipc_tcr_error_t
Error codes in the error TCR.
int l4_ipc_is_rcv_error(l4_utcb_t *utcb) L4_NOTHROW
Returns whether an error occurred in receive phase of an invocation.
l4_umword_t l4_ipc_error(l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
Get the IPC error code for an IPC operation.
@ L4_IPC_SEABORTED
Send operation aborted.
@ L4_IPC_SND_ERR_MASK
Send error mask.
@ L4_IPC_RECANCELED
Receive operation canceled.
@ L4_IPC_SESNDPFTO
Send-pagefault timeout in send operation.
@ L4_IPC_SETIMEOUT
Timeout during send operation.
@ L4_IPC_ENOT_EXISTENT
Non-existing destination or source.
@ L4_IPC_ERROR_MASK
Mask for error bits.
@ L4_IPC_REMAPFAILED
Map flexpage failed in receive operation.
@ L4_IPC_SEMAPFAILED
Map flexpage failed in send operation.
@ L4_IPC_SECANCELED
Send operation canceled.
@ L4_IPC_REABORTED
Receive operation aborted.
@ L4_IPC_SERCVPFTO
Receive-pagefault timeout in send operation.
@ L4_IPC_SEMSGCUT
Sent message truncated.
@ L4_IPC_REMSGCUT
Received message truncated.
@ L4_IPC_RETIMEOUT
Timeout during receive operation.
@ L4_IPC_RESNDPFTO
Send-pagefault timeout in receive operation.
@ L4_IPC_RERCVPFTO
Receive-pagefault timeout in receive operation.
@ L4_ITEM_MAP
Identify a message item as map item.
@ L4_ITEM_CONT
Denote that the following item shall be put into the same receive item as this one.
unsigned l4_msgtag_items(l4_msgtag_t t) L4_NOTHROW
Get the number of typed items.
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
unsigned l4_msgtag_words(l4_msgtag_t t) L4_NOTHROW
Get the number of untyped words.
unsigned l4_msgtag_flags(l4_msgtag_t t) L4_NOTHROW
Get the flags.
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
#define L4_IPC_TIMEOUT_NEVER
never timeout
L4_CONSTEXPR l4_timeout_t l4_timeout(l4_timeout_s snd, l4_timeout_s rcv) L4_NOTHROW
Combine send and receive timeout in a timeout.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
#define L4_ALWAYS_INLINE
Always inline a function.
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
#define L4_UNLIKELY(x)
Expression is unlikely to execute.
#define L4_INLINE
L4 Inline function attribute.
#define L4_LIKELY(x)
Expression is likely to execute.
long l4_ipc_to_errno(unsigned long ipc_error_code) L4_NOTHROW
Get a negative error code for the given IPC error code.
Common L4 ABI Data Types.
Message tag data structure.
l4_umword_t error
System call error codes.
Encapsulation of the message-register block in the UTCB.
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.