L4Re - L4 Runtime Environment
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 error code for an object invocation. More...
 
long l4_error (l4_msgtag_t tag) L4_NOTHROW
 Return error code of a system call return message tag. More...
 
int l4_ipc_is_snd_error (l4_utcb_t *utcb) L4_NOTHROW
 Returns whether an error occurred in send phase of an invocation. More...
 
int l4_ipc_is_rcv_error (l4_utcb_t *utcb) L4_NOTHROW
 Returns whether an error occurred in receive phase of an invocation. More...
 
int l4_ipc_error_code (l4_utcb_t *utcb) L4_NOTHROW
 Get the error condition of the last invocation from the TCR. More...
 

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 

Cut receive message, due to message buffer is too small.

L4_IPC_SEMSGCUT 

Cut send message.

due to message buffer is too small,

Definition at line 75 of file ipc.h.

Function Documentation

◆ l4_error()

long l4_error ( l4_msgtag_t  tag)
inline

Return error code of a system call return message tag.

Parameters
tagSystem call return message type
Returns
0 for no error, error number in case of error
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 517 of file ipc.h.

Referenced by L4Re::Mem_alloc::alloc(), fiasco_tbuf_log(), fiasco_tbuf_log_3val(), fiasco_tbuf_log_binary(), and l4_vcon_write_u().

+ 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 error code for an object invocation.

Parameters
tagReturn value of the invocation.
utcbUTCB that was used for the invocation.
Returns
0 if no error condition is set, error code otherwise (see l4_ipc_tcr_error_t).
Examples:
examples/sys/ipc/ipc_example.c, examples/sys/isr/main.c, and examples/sys/start-with-exc/main.c.

Definition at line 500 of file ipc.h.

References l4_msgtag_has_error().

Referenced by l4util_ioport_map().

+ 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 529 of file ipc.h.

◆ 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 526 of file ipc.h.

◆ 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 523 of file ipc.h.