L4Re Operating System Framework
Interface and Usage Documentation
|
API for L4 object invocation. More...
Modules | |
Error Handling | |
Error handling for L4 object invocation. | |
Message Items | |
Message item related functions. | |
Message Tag | |
API related to the message tag data type. | |
Realtime API | |
Timeouts | |
All kinds of timeouts and time related functions. | |
Virtual Registers (UTCBs) | |
L4 Virtual Registers (UTCB). | |
Files | |
file | utcb.h |
UTCB definitions. | |
Enumerations | |
enum | l4_syscall_flags_t { L4_SYSF_NONE , L4_SYSF_SEND , L4_SYSF_RECV , L4_SYSF_OPEN_WAIT , L4_SYSF_REPLY , L4_SYSF_CALL , L4_SYSF_WAIT , L4_SYSF_SEND_AND_WAIT , L4_SYSF_REPLY_AND_WAIT } |
Capability selector flags. More... | |
Functions | |
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_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_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_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_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_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 (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_sleep (l4_timeout_t timeout) L4_NOTHROW |
Sleep for an amount of time. | |
l4_msgtag_t | l4_ipc_sleep_ms (l4_uint32_t ms) L4_NOTHROW |
Sleep for a certain amount of milliseconds. | |
l4_msgtag_t | l4_ipc_sleep_us (l4_uint64_t us) L4_NOTHROW |
Sleep for a certain amount of microseconds. | |
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. | |
API for L4 object invocation.
General abstractions for L4 object invocation. The basic principle is that all objects are denoted by a capability that is accessed via a capability selector (see Capabilities ).
This set of functions is common to all kinds of objects provided by the L4 micro kernel. The concrete semantics of an invocation depends on the object that shall be invoked.
Objects may be invoked in various ways, the most common way is to use a call operation (l4_ipc_call()). However, there are a lot more flavours available that have a semantics depending on the object.
IPC operation between two communication partners may consist of up to two phases (send phase and receive phase). For both phases, a timeout may be specified (send timeout and receive timeout).
enum l4_syscall_flags_t |
Capability selector flags.
These flags determine the concrete operation when a kernel object is invoked.
The following combinations of flags are supported when invoking IPC (see l4_ipc()); with other combinations, behavior is undefined:
Enumerator | |
---|---|
L4_SYSF_NONE | Empty set of flags.
|
L4_SYSF_SEND | Send-phase flag. Setting this flag in a capability selector induces a send phase, this means a message is sent to the object denoted by the capability. For receive phase see L4_SYSF_RECV. In l4_vcpu_state_t::user_task this flag means that the kernel has cached the user task capability internally, see l4_thread_vcpu_resume_commit(). |
L4_SYSF_RECV | Receive-phase flag. Setting this flag in a capability selector induces a receive phase, this means the invoking thread waits for a message from the object denoted by the capability. For a send phase see L4_SYSF_SEND. |
L4_SYSF_OPEN_WAIT | Open-wait flag. This flag indicates that the receive operation (see L4_SYSF_RECV) shall be an open wait. Open wait means that the invoking thread shall wait for a message from any possible sender and not from the sender denoted by the capability. |
L4_SYSF_REPLY | Reply flag. This flag indicates that the send phase shall use the in-kernel reply capability instead of the capability denoted by the selector index. |
L4_SYSF_CALL | Call flags (combines send and receive). Combines L4_SYSF_SEND and L4_SYSF_RECV. |
L4_SYSF_WAIT | Wait flags (combines receive and open wait). Combines L4_SYSF_RECV and L4_SYSF_OPEN_WAIT. |
L4_SYSF_SEND_AND_WAIT | Send-and-wait flags. Combines L4_SYSF_SEND and L4_SYSF_WAIT. |
L4_SYSF_REPLY_AND_WAIT | Reply-and-wait flags. Combines L4_SYSF_SEND, L4_SYSF_REPLY, and L4_SYSF_WAIT. |
|
inline |
Generic L4 object invocation.
dest | Destination object. L4_INVALID_CAP denotes the current thread. An IPC to the current thread will always abort after the specified timeout and can be used for sleeping without busy waiting. | |
utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. | |
flags | Invocation flags (see l4_syscall_flags_t). | |
slabel | Send label if applicable (may be seen by the receiver). | |
tag | Sending message tag. | |
[out] | rlabel | Receiving label. |
timeout | Timeout pair (see l4_timeout_t). |
Definition at line 34 of file ipc.h.
References l4_msgtag_t::raw.
Referenced by l4_ipc_call(), l4_ipc_receive(), l4_ipc_reply_and_wait(), l4_ipc_send(), l4_ipc_send_and_wait(), and l4_ipc_wait().
|
inline |
Object call (usual invocation).
object | Capability selector for the object to call. A value of L4_INVALID_CAP denotes the current thread and will abort the IPC after the time specified in the snd part of the timeout parameter has expired. |
utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. |
tag | Message tag to describe the message to be sent. |
timeout | Timeout pair for send an receive phase (see l4_timeout_t). |
A message is sent to the object and the invoker waits for a reply from the object. Messages from other sources are not accepted.
Definition at line 576 of file ipc.h.
References l4_ipc(), and L4_SYSF_CALL.
Referenced by __kdebug_3_text(), __kdebug_op(), __kdebug_op_1(), __kdebug_text(), L4::Ipc::Iostream::call(), enter_kdebug(), fiasco_amd64_segment_info(), fiasco_amd64_set_fs(), fiasco_amd64_set_segment_base(), fiasco_gdt_get_entry_offset(), fiasco_gdt_set(), fiasco_ldt_set(), l4_icu_bind_u(), l4_icu_info_u(), l4_icu_msi_info_u(), l4_icu_set_mode_u(), l4_icu_unbind_u(), l4_irq_detach_u(), l4_irq_mux_chain_u(), l4_irq_receive_u(), l4_thread_ex_regs_u(), l4_thread_vcpu_control_ext_u(), l4_thread_vcpu_control_u(), l4_vcon_get_attr_u(), l4_vcon_set_attr_u(), l4util_ioport_map(), and L4::Thread::modify_senders().
|
inline |
Wait for a message from a specific source.
object | Object to receive a message from. A value of L4_INVALID_CAP denotes the current thread. It could be used for sleeping without busy waiting for the time specified in the rcv part of the timeout parameter. |
utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. |
timeout | Timeout pair (see l4_timeout_t, only the receive part matters). |
This operation waits for a message from the specified object. Messages from other sources are not accepted by this operation. The operation does not include a send phase, this means no message is sent to the object.
Definition at line 613 of file ipc.h.
References l4_ipc(), L4_SYSF_RECV, and l4_msgtag_t::raw.
Referenced by l4_ipc_sleep(), and l4_thread_yield().
|
inline |
Reply and wait operation (uses the reply capability).
utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. | |
tag | Describes the message to be sent as reply. | |
[out] | label | Label assigned to the source object of the received message. |
timeout | Timeout pair (see l4_timeout_t). |
A message is sent to the previous caller using the implicit reply capability. Afterwards the invoking thread waits for a message from any source.
Definition at line 583 of file ipc.h.
References L4_INVALID_CAP, l4_ipc(), and L4_SYSF_REPLY_AND_WAIT.
Referenced by L4::Ipc::Iostream::reply_and_wait(), and L4::Server< LOOP_HOOKS >::reply_n_wait().
|
inline |
Send a message to an object (do not wait for a reply).
dest | Capability selector for the destination object. A value of L4_INVALID_CAP denotes the current thread and could be used for sleeping without busy waiting for the time specified in the snd part of the timeout parameter. |
utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. |
tag | Descriptor for the message to be sent. |
timeout | Timeout pair (see l4_timeout_t) only send part is relevant. |
A message is sent to the destination object. There is no receive phase included. The invoker continues working after sending the message.
Definition at line 597 of file ipc.h.
References l4_ipc(), and L4_SYSF_SEND.
Referenced by l4_irq_trigger_u(), l4_irq_unmask_u(), l4_vcon_send_u(), L4::Server< LOOP_HOOKS >::reply_n_wait(), and L4::Ipc::Ostream::send().
|
inline |
Send a message and do an open wait.
dest | Object to send a message to. A value of L4_INVALID_CAP denotes the current thread and will abort the IPC after the time specified in the snd part of the timeout parameter has expired. | |
utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. | |
tag | Describes the message that shall be sent. | |
[out] | label | Label assigned to the source object of the receive phase. |
timeout | Timeout pair (see l4_timeout_t). |
A message is sent to the destination object and the invoking thread waits for a reply from any source.
Definition at line 590 of file ipc.h.
References l4_ipc(), and L4_SYSF_SEND_AND_WAIT.
Referenced by l4_irq_wait_u().
|
inline |
Sleep for an amount of time.
timeout | Timeout pair (see l4_timeout_t, the receive part matters). |
The invoking thread waits until the timeout is expired or the wait was aborted by another thread by l4_thread_ex_regs().
Definition at line 622 of file ipc.h.
References L4_INVALID_CAP, and l4_ipc_receive().
Referenced by l4_ipc_sleep_ms(), l4_ipc_sleep_us(), and l4_sleep_forever().
|
inline |
Sleep for a certain amount of milliseconds.
ms | Number of milliseconds to wait. |
The invoking thread waits until the timeout is expired or the wait was aborted by another thread by l4_thread_ex_regs().
Definition at line 626 of file ipc.h.
References l4_ipc_sleep(), L4_IPC_TIMEOUT_NEVER, and l4_timeout().
|
inline |
Sleep for a certain amount of microseconds.
us | Number of microseconds to wait. |
The invoking thread waits until the timeout is expired or the wait was aborted by another thread by l4_thread_ex_regs().
Definition at line 633 of file ipc.h.
References l4_ipc_sleep(), L4_IPC_TIMEOUT_NEVER, and l4_timeout().
|
inline |
Wait for an incoming message from any possible sender.
utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. | |
[out] | label | Label assigned to the source object (IPC gate or IRQ). |
timeout | Timeout pair (see l4_timeout_t, only the receive part is used). |
This operation does an open wait, and therefore needs no capability to denote the possible source of a message. This means the calling thread waits for an incoming message from any possible source. There is no send phase included in this operation.
The usual usage of this function is to call that function when entering a server loop in a user-level server that implements user-level objects, see also l4_ipc_reply_and_wait().
Definition at line 604 of file ipc.h.
References L4_INVALID_CAP, l4_ipc(), L4_SYSF_WAIT, and l4_msgtag_t::raw.
Referenced by L4::Server< LOOP_HOOKS >::reply_n_wait(), and L4::Ipc::Istream::wait().
|
inline |
Add a flex-page to be sent to the UTCB.
snd_fpage | Flex-page. | |
snd_base | Send base. | |
[in,out] | tag | Tag to be updated. Only the number of items is incremented in the updated tag, all other members remain unmodified. |
Definition at line 696 of file ipc.h.
References l4_utcb().