25 #include <nucleus/synch.h>
29 #define S_PRIO XNSYNCH_PRIO
30 #define S_FIFO XNSYNCH_FIFO
33 typedef struct rt_sem_info {
39 char name[XNOBJECT_NAME_LEN];
43 typedef struct rt_sem_placeholder {
47 #if (defined(__KERNEL__) || defined(__XENO_SIM__)) && !defined(DOXYGEN_CPP)
51 #define XENO_SEM_MAGIC 0x55550303
53 typedef struct rt_sem {
65 char name[XNOBJECT_NAME_LEN];
67 #ifdef CONFIG_XENO_OPT_PERVASIVE
73 #define rlink2sem(ln) container_of(ln, RT_SEM, rlink)
83 #ifdef CONFIG_XENO_OPT_NATIVE_SEM
85 int __native_sem_pkg_init(
void);
87 void __native_sem_pkg_cleanup(
void);
89 static inline void __native_sem_flush_rq(xnqueue_t *rq)
91 xeno_flush_rq(RT_SEM, rq, sem);
94 int rt_sem_p_inner(RT_SEM *sem,
95 xntmode_t timeout_mode, RTIME timeout);
99 #define __native_sem_pkg_init() ({ 0; })
100 #define __native_sem_pkg_cleanup() do { } while(0)
101 #define __native_sem_flush_rq(rq) do { } while(0)
111 typedef RT_SEM_PLACEHOLDER RT_SEM;
124 sem->opaque = XN_NO_HANDLE;
142 unsigned long icount,
int rt_sem_inquire(RT_SEM *sem, RT_SEM_INFO *info)
Inquire about a semaphore.
Definition: sem.c:81
int rt_sem_broadcast(RT_SEM *sem)
Broadcast a semaphore.
Definition: sem.c:76
int rt_sem_bind(RT_SEM *sem, const char *name, RTIME timeout)
Bind to a semaphore.
Definition: sem.c:32
int rt_sem_v(RT_SEM *sem)
Signal a semaphore.
Definition: sem.c:71
int rt_sem_p_until(RT_SEM *sem, RTIME timeout)
Pend on a semaphore (with absolute timeout date).
Definition: sem.c:57
int rt_sem_create(RT_SEM *sem, const char *name, unsigned long icount, int mode)
Create a counting semaphore.
Definition: sem.c:26
static int rt_sem_unbind(RT_SEM *sem)
Unbind from a semaphore.
Definition: sem.h:121
This file is part of the Xenomai project.
int rt_sem_p(RT_SEM *sem, RTIME timeout)
Pend on a semaphore.
Definition: sem.c:43
int rt_sem_delete(RT_SEM *sem)
Delete a semaphore.
Definition: sem.c:38
This file is part of the Xenomai project.