]> rtime.felk.cvut.cz Git - zynq/linux.git/blob - include/linux/rwlock_types_rt.h
Apply preempt_rt patch-4.9-rt1.patch.xz
[zynq/linux.git] / include / linux / rwlock_types_rt.h
1 #ifndef __LINUX_RWLOCK_TYPES_RT_H
2 #define __LINUX_RWLOCK_TYPES_RT_H
3
4 #ifndef __LINUX_SPINLOCK_TYPES_H
5 #error "Do not include directly. Include spinlock_types.h instead"
6 #endif
7
8 /*
9  * rwlocks - rtmutex which allows single reader recursion
10  */
11 typedef struct {
12         struct rt_mutex         lock;
13         int                     read_depth;
14         unsigned int            break_lock;
15 #ifdef CONFIG_DEBUG_LOCK_ALLOC
16         struct lockdep_map      dep_map;
17 #endif
18 } rwlock_t;
19
20 #ifdef CONFIG_DEBUG_LOCK_ALLOC
21 # define RW_DEP_MAP_INIT(lockname)      .dep_map = { .name = #lockname }
22 #else
23 # define RW_DEP_MAP_INIT(lockname)
24 #endif
25
26 #define __RW_LOCK_UNLOCKED(name) \
27         { .lock = __RT_MUTEX_INITIALIZER_SAVE_STATE(name.lock), \
28           RW_DEP_MAP_INIT(name) }
29
30 #define DEFINE_RWLOCK(name) \
31         rwlock_t name = __RW_LOCK_UNLOCKED(name)
32
33 #endif