1#ifndef __VSF_LINUX_SEMAPHORE_H__
2#define __VSF_LINUX_SEMAPHORE_H__
7#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED && VSF_LINUX_USE_SIMPLE_TIME == ENABLED
17#if VSF_LINUX_CFG_WRAPPER == ENABLED
18#define sem_init VSF_LINUX_WRAPPER(sem_init)
19#define sem_destroy VSF_LINUX_WRAPPER(sem_destroy)
20#define sem_wait VSF_LINUX_WRAPPER(sem_wait)
21#define sem_trywait VSF_LINUX_WRAPPER(sem_trywait)
22#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
23# define sem_timedwait VSF_LINUX_WRAPPER(sem_timedwait)
25#define sem_post VSF_LINUX_WRAPPER(sem_post)
26#define sem_getvalue VSF_LINUX_WRAPPER(sem_getvalue)
29#define SEM_FAILED ((sem_t *)NULL)
33#if VSF_LINUX_APPLET_USE_SEMAPHORE == ENABLED
45# ifndef __VSF_APPLET__
50#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_SEMAPHORE_LIB__))\
51 && VSF_APPLET_CFG_ABI_PATCH != ENABLED && VSF_LINUX_APPLET_USE_SEMAPHORE == ENABLED
53#ifndef VSF_LINUX_APPLET_SEMAPHORE_VPLT
54# if VSF_LINUX_USE_APPLET == ENABLED
55# define VSF_LINUX_APPLET_SEMAPHORE_VPLT \
56 ((vsf_linux_semaphore_vplt_t *)(VSF_LINUX_APPLET_VPLT->semaphore_vplt))
58# define VSF_LINUX_APPLET_SEMAPHORE_VPLT \
59 ((vsf_linux_semaphore_vplt_t *)vsf_vplt((void *)0))
63#define VSF_LINUX_APPLET_SEMAPHORE_ENTRY(__NAME) \
64 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_SEMAPHORE_VPLT, __NAME)
65#define VSF_LINUX_APPLET_SEMAPHORE_IMP(...) \
66 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_SEMAPHORE_VPLT, __VA_ARGS__)
68VSF_LINUX_APPLET_SEMAPHORE_IMP(
sem_init,
int,
sem_t *sem,
int pshared,
unsigned int value) {
70 return VSF_LINUX_APPLET_SEMAPHORE_ENTRY(
sem_init)(sem, pshared,
value);
74 return VSF_LINUX_APPLET_SEMAPHORE_ENTRY(
sem_destroy)(sem);
78 return VSF_LINUX_APPLET_SEMAPHORE_ENTRY(
sem_wait)(sem);
82 return VSF_LINUX_APPLET_SEMAPHORE_ENTRY(
sem_trywait)(sem);
86 return VSF_LINUX_APPLET_SEMAPHORE_ENTRY(
sem_timedwait)(sem, abs_timeout);
90 return VSF_LINUX_APPLET_SEMAPHORE_ENTRY(
sem_post)(sem);
103#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
unsigned int mode_t
Definition types.h:87
vsf_sem_t sem_t
Definition semaphore.h:31
#define sem_post
Definition semaphore.h:25
#define sem_destroy
Definition semaphore.h:19
sem_t * sem_open(const char *name, int oflag, mode_t mode, unsigned int value)
Definition vsf_linux_glibc_sem.c:114
int sem_close(sem_t *sem)
Definition vsf_linux_glibc_sem.c:126
#define sem_trywait
Definition semaphore.h:21
__VSF_VPLT_DECORATOR__ vsf_linux_semaphore_vplt_t vsf_linux_semaphore_vplt
Definition vsf_linux_glibc_sem.c:153
int sem_unlink(const char *name)
Definition vsf_linux_glibc_sem.c:120
#define sem_wait
Definition semaphore.h:20
#define sem_init
Definition semaphore.h:18
#define sem_getvalue
Definition semaphore.h:26
#define sem_timedwait
Definition semaphore.h:23
Definition semaphore.h:34
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sem_init)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sem_destroy)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sem_post)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sem_wait)
vsf_vplt_info_t info
Definition semaphore.h:35
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sem_trywait)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sem_getvalue)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sem_timedwait)
vk_av_control_value_t value
Definition vsf_audio.h:171
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165