L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
Error Handling

Error handling for L4 object invocation. More...

+ Collaboration diagram for Error Handling:

Enumerations

enum  l4_ipc_tcr_error_t {
  L4_IPC_ERROR_MASK = 0x1F , L4_IPC_SND_ERR_MASK = 0x01 , L4_IPC_ENOT_EXISTENT = 0x04 , L4_IPC_RETIMEOUT = 0x03 ,
  L4_IPC_SETIMEOUT = 0x02 , L4_IPC_RECANCELED = 0x07 , L4_IPC_SECANCELED = 0x06 , L4_IPC_REMAPFAILED = 0x11 ,
  L4_IPC_SEMAPFAILED = 0x10 , L4_IPC_RESNDPFTO = 0x0b , L4_IPC_SESNDPFTO = 0x0a , L4_IPC_RERCVPFTO = 0x0d ,
  L4_IPC_SERCVPFTO = 0x0c , L4_IPC_REABORTED = 0x0f , L4_IPC_SEABORTED = 0x0e , L4_IPC_REMSGCUT = 0x09 ,
  L4_IPC_SEMSGCUT = 0x08
}
 Error codes in the error TCR. More...
 

Functions

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.
 
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_is_rcv_error (l4_utcb_t *utcb) L4_NOTHROW
 Returns whether an error occurred in receive 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.
 

Detailed Description

Error handling for L4 object invocation.

Include File
#include <l4/sys/ipc.h>

Enumeration Type Documentation

◆ l4_ipc_tcr_error_t

Error codes in the error TCR.

The error codes are accessible via the error TCR, see l4_thread_regs_t.error.

Enumerator
L4_IPC_ERROR_MASK 

Mask for error bits.

L4_IPC_SND_ERR_MASK 

Send error mask.

L4_IPC_ENOT_EXISTENT 

Non-existing destination or source.

L4_IPC_RETIMEOUT 

Timeout during receive operation.

L4_IPC_SETIMEOUT 

Timeout during send operation.

L4_IPC_RECANCELED 

Receive operation canceled.

L4_IPC_SECANCELED 

Send operation canceled.

L4_IPC_REMAPFAILED 

Map flexpage failed in receive operation.

L4_IPC_SEMAPFAILED 

Map flexpage failed in send operation.

L4_IPC_RESNDPFTO 

Send-pagefault timeout in receive operation.

L4_IPC_SESNDPFTO 

Send-pagefault timeout in send operation.

L4_IPC_RERCVPFTO 

Receive-pagefault timeout in receive operation.

L4_IPC_SERCVPFTO 

Receive-pagefault timeout in send operation.

L4_IPC_REABORTED 

Receive operation aborted.

L4_IPC_SEABORTED 

Send operation aborted.

L4_IPC_REMSGCUT 

Received message truncated.

Usually returned when the typed items to be sent by the IPC partner exceed the buffer registers of the respective types.

L4_IPC_SEMSGCUT 

Sent message truncated.

Usually returned when the typed items to be sent exceed the IPC partner’s buffer registers of the respective types.

Definition at line 75 of file ipc.h.

Function Documentation

◆ l4_error()

long l4_error ( l4_msgtag_t  tag)
inline

Get IPC error code if any or message tag label otherwise for an IPC call.

This function shall only be used if the IPC operation includes a receive phase (usually a call operation), otherwise no tag label is received and the return value of this function is undefined.

Parameters
tagMessage tag returned by the IPC call.
Returns
In case of an IPC error, a negative error code in the range of L4_EIPC_LO to L4_EIPC_HI (see l4_ipc_to_errno() and l4_ipc_tcr_error_t), otherwise the tag label. By convention, the callee can signal errors via a negative tag label (negated value from l4_error_code_t) and success via a non-negative value.
Examples
examples/libs/l4re/streammap/client.cc, examples/sys/aliens/main.c, examples/sys/isr/main.c, examples/sys/migrate/thread_migrate.cc, examples/sys/singlestep/main.c, examples/sys/start-with-exc/main.c, and examples/sys/utcb-ipc/main.c.

Definition at line 636 of file ipc.h.

References l4_utcb().

Referenced by L4Re::Mem_alloc::alloc(), L4virtio::Driver::Device::bind_notification_irq(), L4::cap_dynamic_cast(), L4virtio::Driver::Device::driver_connect(), fiasco_tbuf_log(), fiasco_tbuf_log_3val(), fiasco_tbuf_log_binary(), L4Re::Util::Event_t< PAYLOAD >::init(), l4_vcon_write_u(), and L4Re::Util::Event_buffer_consumer_t< PAYLOAD >::process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4_ipc_error()

l4_umword_t l4_ipc_error ( l4_msgtag_t  tag,
l4_utcb_t utcb 
)
inline

Get the IPC error code for an IPC operation.

Parameters
tagMessage tag returned by the IPC operation.
utcbUTCB that was used for the IPC operation.
Returns
0 if no error condition is set, error code otherwise (see l4_ipc_tcr_error_t).
Examples
examples/sys/ipc/ipc_example.c, and examples/sys/start-with-exc/main.c.

Definition at line 619 of file ipc.h.

References l4_thread_regs_t::error, L4_IPC_ERROR_MASK, and l4_msgtag_has_error().

Referenced by l4util_ioport_map(), L4Re::Util::Event_buffer_consumer_t< PAYLOAD >::process(), and L4virtio::Driver::Device::wait().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4_ipc_error_code()

int l4_ipc_error_code ( l4_utcb_t utcb)
inline

Get the error condition of the last invocation from the TCR.

Precondition
l4_msgtag_has_error(tag) == true
Parameters
utcbUTCB to check.
Returns
Error condition of type l4_ipc_tcr_error_t.

Definition at line 648 of file ipc.h.

References l4_thread_regs_t::error, and L4_IPC_ERROR_MASK.

◆ l4_ipc_is_rcv_error()

int l4_ipc_is_rcv_error ( l4_utcb_t utcb)
inline

Returns whether an error occurred in receive phase of an invocation.

Precondition
l4_msgtag_has_error(tag) == true
Parameters
utcbUTCB to check.
Returns
Boolean value.

Definition at line 645 of file ipc.h.

References l4_thread_regs_t::error.

◆ l4_ipc_is_snd_error()

int l4_ipc_is_snd_error ( l4_utcb_t utcb)
inline

Returns whether an error occurred in send phase of an invocation.

Precondition
l4_msgtag_has_error(tag) == true
Parameters
utcbUTCB to check.
Returns
Boolean value.

Definition at line 642 of file ipc.h.