L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
Kernel-provided semaphore

C semaphore interface, see L4::Semaphore for the C++ interface. More...

+ Collaboration diagram for Kernel-provided semaphore:

Functions

l4_msgtag_t l4_semaphore_up (l4_cap_idx_t sem) L4_NOTHROW
 Semaphore up operation (wrapper for trigger()).
 
l4_msgtag_t l4_semaphore_down (l4_cap_idx_t sem, l4_timeout_t timeout) L4_NOTHROW
 Semaphore down operation.
 

Detailed Description

C semaphore interface, see L4::Semaphore for the C++ interface.

Include File
#include <l4/sys/semaphore.h>
C semaphore interface.

Function Documentation

◆ l4_semaphore_down()

l4_msgtag_t l4_semaphore_down ( l4_cap_idx_t  sem,
l4_timeout_t  timeout 
)
inline

Semaphore down operation.

Parameters
semSemaphore object.
timeoutTimeout for blocking the semaphore down operation. Note: The receive timeout of this timeout-pair is significant for blocking, the send part is usually non-blocking.
Returns
Syscall return tag. Use l4_error() to check for errors.
Return values
-L4_EPERMNo L4_CAP_FPAGE_S right on invoked semaphore capability.

This method decrements the semaphore counter by one, or blocks if the counter is already zero, until either a timeout or cancel condition hits or the counter is increased by an up() operation.

Definition at line 110 of file semaphore.h.

References l4_utcb().

+ Here is the call graph for this function:

◆ l4_semaphore_up()

l4_msgtag_t l4_semaphore_up ( l4_cap_idx_t  sem)
inline

Semaphore up operation (wrapper for trigger()).

Parameters
semSemaphore object.
Returns
Send-only IPC message return tag. Use l4_ipc_error() to check for errors, do not use l4_error().

Increases the semaphore counter by one if it is smaller than an unspecified limit. The unspecified limit is guaranteed to be at least 2^31-1.

Definition at line 56 of file semaphore.h.

References l4_irq_trigger().

+ Here is the call graph for this function: