• Home
  • Raw
  • Download

Lines Matching refs:sem

34 static inline void __down_read(struct rw_semaphore *sem)  in __down_read()  argument
36 if (unlikely(atomic_long_inc_return((atomic_long_t *)&sem->count) <= 0)) in __down_read()
37 rwsem_down_read_failed(sem); in __down_read()
40 static inline int __down_read_trylock(struct rw_semaphore *sem) in __down_read_trylock() argument
44 while ((tmp = sem->count) >= 0) { in __down_read_trylock()
45 if (tmp == cmpxchg(&sem->count, tmp, in __down_read_trylock()
56 static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) in __down_write_nested() argument
61 (atomic_long_t *)&sem->count); in __down_write_nested()
63 rwsem_down_write_failed(sem); in __down_write_nested()
66 static inline void __down_write(struct rw_semaphore *sem) in __down_write() argument
68 __down_write_nested(sem, 0); in __down_write()
71 static inline int __down_write_trylock(struct rw_semaphore *sem) in __down_write_trylock() argument
75 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, in __down_write_trylock()
83 static inline void __up_read(struct rw_semaphore *sem) in __up_read() argument
87 tmp = atomic_long_dec_return((atomic_long_t *)&sem->count); in __up_read()
89 rwsem_wake(sem); in __up_read()
95 static inline void __up_write(struct rw_semaphore *sem) in __up_write() argument
98 (atomic_long_t *)&sem->count) < 0)) in __up_write()
99 rwsem_wake(sem); in __up_write()
105 static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem) in rwsem_atomic_add() argument
107 atomic_long_add(delta, (atomic_long_t *)&sem->count); in rwsem_atomic_add()
113 static inline void __downgrade_write(struct rw_semaphore *sem) in __downgrade_write() argument
118 (atomic_long_t *)&sem->count); in __downgrade_write()
120 rwsem_downgrade_wake(sem); in __downgrade_write()
126 static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem) in rwsem_atomic_update() argument
128 return atomic_long_add_return(delta, (atomic_long_t *)&sem->count); in rwsem_atomic_update()