1 #ifndef _LINUX_SEMAPHORE_H
2 #define _LINUX_SEMAPHORE_H
3
4 #ifdef CONFIG_PREEMPT_RT
5 # include <linux/rt_lock.h>
6 #else
7
8 #define DECLARE_MUTEX COMPAT_DECLARE_MUTEX
9
10 static inline void sema_init(struct compat_semaphore *sem, int val)
11 {
12 compat_sema_init(sem, val);
13 }
14 static inline void init_MUTEX(struct compat_semaphore *sem)
15 {
16 compat_init_MUTEX(sem);
17 }
18 static inline void init_MUTEX_LOCKED(struct compat_semaphore *sem)
19 {
20 compat_init_MUTEX_LOCKED(sem);
21 }
22 static inline void down(struct compat_semaphore *sem)
23 {
24 compat_down(sem);
25 }
26 static inline int down_interruptible(struct compat_semaphore *sem)
27 {
28 return compat_down_interruptible(sem);
29 }
30 static inline int down_trylock(struct compat_semaphore *sem)
31 {
32 return compat_down_trylock(sem);
33 }
34 static inline void up(struct compat_semaphore *sem)
35 {
36 compat_up(sem);
37 }
38 static inline int sem_is_locked(struct compat_semaphore *sem)
39 {
40 return compat_sem_is_locked(sem);
41 }
42 static inline int sema_count(struct compat_semaphore *sem)
43 {
44 return compat_sema_count(sem);
45 }
46
47 #endif /* CONFIG_PREEMPT_RT */
48
49 #endif /* _LINUX_SEMAPHORE_H */
50
|
This page was automatically generated by the
LXR engine.
|