Semaphore management syscalls.
More...
#include <ppu-lv2.h>
Go to the source code of this file.
|
| LV2_SYSCALL | sysSemCreate (sys_sem_t *sem, const sys_sem_attr_t *attr, s32 initial_val, s32 max_val) |
| | Create a semaphore.
|
| |
| LV2_SYSCALL | sysSemDestroy (sys_sem_t sem) |
| | Destroy a semaphore.
|
| |
| LV2_SYSCALL | sysSemWait (sys_sem_t sem, u64 timeout_usec) |
| | Wait and reserve a semaphore.
|
| |
| LV2_SYSCALL | sysSemTryWait (sys_sem_t sem) |
| | Reserve a semaphore (non-blocking).
|
| |
| LV2_SYSCALL | sysSemPost (sys_sem_t sem, s32 count) |
| | Release a semaphore.
|
| |
| LV2_SYSCALL | sysSemGetValue (sys_sem_t sem, s32 *count) |
| | Get the value of a semaphore.
|
| |
Semaphore management syscalls.
Definition in file sem.h.
◆ SYS_SEM_ATTR_PROTOCOL
| #define SYS_SEM_ATTR_PROTOCOL 0x0002 |
Default protocol for semaphore attributes.
Definition at line 11 of file sem.h.
◆ SYS_SEM_ATTR_PSHARED
| #define SYS_SEM_ATTR_PSHARED 0x0200 |
Default sharing policy for semaphore attributes.
Definition at line 13 of file sem.h.
◆ sys_sem_attr_t
Semaphore sttributes data structure.
◆ sysSemCreate()
| LV2_SYSCALL sysSemCreate |
( |
sys_sem_t * |
sem, |
|
|
const sys_sem_attr_t * |
attr, |
|
|
s32 |
initial_val, |
|
|
s32 |
max_val |
|
) |
| |
Create a semaphore.
- Parameters
-
| sem | Pointer to storage to the semaphore id. |
| attr | Pointer to the semaphore attributes. |
| initial_val | Initial value. |
| max_val | Maximum value. |
- Returns
- zero if no error occured, nonzero otherwise.
Definition at line 43 of file sem.h.
◆ sysSemDestroy()
| LV2_SYSCALL sysSemDestroy |
( |
sys_sem_t |
sem | ) |
|
Destroy a semaphore.
- Parameters
-
- Returns
- zero if no error occured, nonzero otherwise.
Definition at line 53 of file sem.h.
◆ sysSemGetValue()
| LV2_SYSCALL sysSemGetValue |
( |
sys_sem_t |
sem, |
|
|
s32 * |
count |
|
) |
| |
Get the value of a semaphore.
- Parameters
-
| sem | The semaphore id. |
| count | Pointer to storage for the semaphore value. |
- Returns
- zero if no error occured, nonzero otherwise.
Definition at line 98 of file sem.h.
◆ sysSemPost()
| LV2_SYSCALL sysSemPost |
( |
sys_sem_t |
sem, |
|
|
s32 |
count |
|
) |
| |
Release a semaphore.
- Parameters
-
| sem | The semaphore id. |
| count | Increment value. |
- Returns
- zero if no error occured, nonzero otherwise.
Definition at line 87 of file sem.h.
◆ sysSemTryWait()
| LV2_SYSCALL sysSemTryWait |
( |
sys_sem_t |
sem | ) |
|
Reserve a semaphore (non-blocking).
- Parameters
-
- Returns
- zero if the semaphore was successfully reserved, nonzero in case of error or if the semaphore value is below 1.
Definition at line 76 of file sem.h.
◆ sysSemWait()
| LV2_SYSCALL sysSemWait |
( |
sys_sem_t |
sem, |
|
|
u64 |
timeout_usec |
|
) |
| |
Wait and reserve a semaphore.
- Parameters
-
| sem | The semaphore id. |
| timeout_usec | Timeout value in microseconds, or 0 if no timeout is used. |
- Returns
- zero if the semaphore was successfully reserved, nonzero in case of error or if a timeout occured.
Definition at line 65 of file sem.h.