| /include/linux/ |
| A D | spinlock_api_up.h | 28 do { __acquire(lock); (void)(lock); } while (0) 43 do { __release(lock); (void)(lock); } while (0) 58 #define _raw_spin_lock(lock) __LOCK(lock) argument 60 #define _raw_read_lock(lock) __LOCK(lock) argument 61 #define _raw_write_lock(lock) __LOCK(lock) argument 63 #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) argument 64 #define _raw_read_lock_bh(lock) __LOCK_BH(lock) argument 65 #define _raw_write_lock_bh(lock) __LOCK_BH(lock) argument 76 #define _raw_spin_unlock(lock) __UNLOCK(lock) argument 77 #define _raw_read_unlock(lock) __UNLOCK(lock) argument [all …]
|
| A D | rwlock.h | 24 __rwlock_init((lock), #lock, &__key); \ 28 do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0) 52 #define read_trylock(lock) __cond_lock(lock, _raw_read_trylock(lock)) argument 53 #define write_trylock(lock) __cond_lock(lock, _raw_write_trylock(lock)) argument 55 #define write_lock(lock) _raw_write_lock(lock) argument 56 #define read_lock(lock) _raw_read_lock(lock) argument 92 #define read_lock_irq(lock) _raw_read_lock_irq(lock) argument 93 #define read_lock_bh(lock) _raw_read_lock_bh(lock) argument 96 #define read_unlock(lock) _raw_read_unlock(lock) argument 97 #define write_unlock(lock) _raw_write_unlock(lock) argument [all …]
|
| A D | rwlock_api_smp.h | 18 void __lockfunc _raw_read_lock(rwlock_t *lock) __acquires(lock); 19 void __lockfunc _raw_write_lock(rwlock_t *lock) __acquires(lock); 45 #define _raw_read_lock(lock) __raw_read_lock(lock) argument 49 #define _raw_write_lock(lock) __raw_write_lock(lock) argument 53 #define _raw_read_lock_bh(lock) __raw_read_lock_bh(lock) argument 57 #define _raw_write_lock_bh(lock) __raw_write_lock_bh(lock) argument 61 #define _raw_read_lock_irq(lock) __raw_read_lock_irq(lock) argument 77 #define _raw_read_trylock(lock) __raw_read_trylock(lock) argument 81 #define _raw_write_trylock(lock) __raw_write_trylock(lock) argument 85 #define _raw_read_unlock(lock) __raw_read_unlock(lock) argument [all …]
|
| A D | spinlock.h | 108 __raw_spin_lock_init((lock), #lock, &__key, LD_WAIT_SPIN); \ 113 do { *(lock) = __RAW_SPIN_LOCK_UNLOCKED(lock); } while (0) 121 #define raw_spin_is_contended(lock) (((void)(lock), 0)) argument 215 #define raw_spin_trylock(lock) __cond_lock(lock, _raw_spin_trylock(lock)) argument 217 #define raw_spin_lock(lock) _raw_spin_lock(lock) argument 274 #define raw_spin_lock_irq(lock) _raw_spin_lock_irq(lock) argument 275 #define raw_spin_lock_bh(lock) _raw_spin_lock_bh(lock) argument 276 #define raw_spin_unlock(lock) _raw_spin_unlock(lock) argument 284 #define raw_spin_unlock_bh(lock) _raw_spin_unlock_bh(lock) argument 287 __cond_lock(lock, _raw_spin_trylock_bh(lock)) [all …]
|
| A D | spinlock_api_smp.h | 22 void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); 28 void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock) __acquires(lock); 47 #define _raw_spin_lock(lock) __raw_spin_lock(lock) argument 51 #define _raw_spin_lock_bh(lock) __raw_spin_lock_bh(lock) argument 55 #define _raw_spin_lock_irq(lock) __raw_spin_lock_irq(lock) argument 59 #define _raw_spin_lock_irqsave(lock) __raw_spin_lock_irqsave(lock) argument 63 #define _raw_spin_trylock(lock) __raw_spin_trylock(lock) argument 67 #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) argument 71 #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) argument 75 #define _raw_spin_unlock_bh(lock) __raw_spin_unlock_bh(lock) argument [all …]
|
| A D | spinlock_rt.h | 34 extern void rt_spin_lock(spinlock_t *lock) __acquires(lock); 37 extern void rt_spin_unlock(spinlock_t *lock) __releases(lock); 44 rt_spin_lock(lock); in spin_lock() 88 rt_spin_lock(lock); in spin_lock_bh() 93 rt_spin_lock(lock); in spin_lock_irq() 126 __cond_lock(lock, rt_spin_trylock(lock)) 129 __cond_lock(lock, rt_spin_trylock_bh(lock)) 132 __cond_lock(lock, rt_spin_trylock(lock)) 144 #define spin_is_contended(lock) (((void)(lock), 0)) argument 148 return rt_mutex_base_is_locked(&lock->lock); in spin_is_locked() [all …]
|
| A D | spinlock_up.h | 31 lock->slock = 0; in arch_spin_lock() 39 lock->slock = 0; in arch_spin_trylock() 48 lock->slock = 1; in arch_spin_unlock() 54 #define arch_read_lock(lock) do { barrier(); (void)(lock); } while (0) argument 55 #define arch_write_lock(lock) do { barrier(); (void)(lock); } while (0) argument 56 #define arch_read_trylock(lock) ({ barrier(); (void)(lock); 1; }) argument 57 #define arch_write_trylock(lock) ({ barrier(); (void)(lock); 1; }) argument 62 #define arch_spin_is_locked(lock) ((void)(lock), 0) argument 64 # define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0) argument 66 # define arch_spin_trylock(lock) ({ barrier(); (void)(lock); 1; }) argument [all …]
|
| A D | mutex.h | 168 #define mutex_lock(lock) mutex_lock_nested(lock, 0) argument 169 #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) argument 170 #define mutex_lock_killable(lock) _mutex_lock_killable(lock, 0, NULL) argument 171 #define mutex_lock_io(lock) mutex_lock_io_nested(lock, 0) argument 194 # define mutex_lock_nested(lock, subclass) mutex_lock(lock) argument 196 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) argument 197 # define mutex_lock_killable_nest_lock(lock, nest_lock) mutex_lock_killable(lock) argument 198 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) argument 199 # define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock) argument 218 #define mutex_trylock(lock) _mutex_trylock_nest_lock(lock, NULL) argument [all …]
|
| A D | local_lock_internal.h | 77 debug_check_no_locks_freed((void *)lock, sizeof(*lock));\ 78 lockdep_init_map_type(&(lock)->dep_map, #lock, &__key, \ 84 #define __local_trylock_init(lock) __local_lock_init(lock.llock) argument 90 debug_check_no_locks_freed((void *)lock, sizeof(*lock));\ 91 lockdep_init_map_type(&(lock)->dep_map, #lock, &__key, \ 104 _Generic((lock), \ 136 tl = (lock); \ 153 tl = (lock); \ 233 #define __local_lock_irq(lock) __local_lock(lock) argument 248 #define __local_unlock_irq(lock) __local_unlock(lock) argument [all …]
|
| A D | local_lock.h | 10 #define local_lock_init(lock) __local_lock_init(lock) argument 16 #define local_lock(lock) __local_lock(this_cpu_ptr(lock)) argument 22 #define local_lock_irq(lock) __local_lock_irq(this_cpu_ptr(lock)) argument 30 #define local_lock_irqsave(lock, flags) \ argument 31 __local_lock_irqsave(this_cpu_ptr(lock), flags) 37 #define local_unlock(lock) __local_unlock(this_cpu_ptr(lock)) argument 43 #define local_unlock_irq(lock) __local_unlock_irq(this_cpu_ptr(lock)) argument 57 #define local_trylock_init(lock) __local_trylock_init(lock) argument 67 #define local_trylock(lock) __local_trylock(this_cpu_ptr(lock)) argument 79 #define local_trylock_irqsave(lock, flags) \ argument [all …]
|
| A D | rtmutex.h | 44 return READ_ONCE(lock->owner) != NULL; in rt_mutex_base_is_locked() 103 #define rt_mutex_lock(lock) rt_mutex_lock_nested(lock, 0) argument 104 #define rt_mutex_lock_nest_lock(lock, nest_lock) \ argument 107 _rt_mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ 111 extern void rt_mutex_lock(struct rt_mutex *lock); 112 #define rt_mutex_lock_nested(lock, subclass) rt_mutex_lock(lock) argument 113 #define rt_mutex_lock_nest_lock(lock, nest_lock) rt_mutex_lock(lock) argument 116 extern int rt_mutex_lock_interruptible(struct rt_mutex *lock); 117 extern int rt_mutex_lock_killable(struct rt_mutex *lock); 118 extern int rt_mutex_trylock(struct rt_mutex *lock); [all …]
|
| A D | lockdep.h | 176 lockdep_init_map_type(&(lock)->dep_map, (lock)->dep_map.name, (lock)->dep_map.key, sub,\ 190 lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock) 200 lockdep_set_class_and_name(lock, &__lockdep_no_track__, #lock) 205 #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key) argument 210 return lock->key == key; in lockdep_match_key() 252 #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map) argument 253 #define lockdep_is_held_type(lock, r) lock_is_held_type(&(lock)->dep_map, (r)) argument 265 lock_set_class(lock, lock->name, lock->key, subclass, ip); in lock_set_subclass() 445 lock(_lock); \ 468 lock(_lock) [all …]
|
| A D | seqlock.h | 131 #define seqcount_spinlock_init(s, lock) seqcount_LOCKNAME_init(s, lock, spinlock) argument 132 #define seqcount_rwlock_init(s, lock) seqcount_LOCKNAME_init(s, lock, rwlock) argument 133 #define seqcount_mutex_init(s, lock) seqcount_LOCKNAME_init(s, lock, mutex) argument 243 #define SEQCNT_RAW_SPINLOCK_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 244 #define SEQCNT_SPINLOCK_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 245 #define SEQCNT_RWLOCK_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 246 #define SEQCNT_MUTEX_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 247 #define SEQCNT_WW_MUTEX_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 876 spin_lock(&sl->lock); in write_seqlock() 890 spin_unlock(&sl->lock); in write_sequnlock() [all …]
|
| A D | osq_lock.h | 23 static inline void osq_lock_init(struct optimistic_spin_queue *lock) in osq_lock_init() argument 25 atomic_set(&lock->tail, OSQ_UNLOCKED_VAL); in osq_lock_init() 28 extern bool osq_lock(struct optimistic_spin_queue *lock); 29 extern void osq_unlock(struct optimistic_spin_queue *lock); 31 static inline bool osq_is_locked(struct optimistic_spin_queue *lock) in osq_is_locked() argument 33 return atomic_read(&lock->tail) != OSQ_UNLOCKED_VAL; in osq_is_locked()
|
| A D | rwlock_rt.h | 51 #define read_lock_irqsave(lock, flags) \ argument 54 rt_read_lock(lock); \ 58 #define read_trylock(lock) __cond_lock(lock, rt_read_trylock(lock)) argument 93 #define write_lock_nested(lock, subclass) rt_write_lock(((void)(subclass), (lock))) argument 107 #define write_lock_irqsave(lock, flags) \ argument 110 rt_write_lock(lock); \ 114 #define write_trylock(lock) __cond_lock(lock, rt_write_trylock(lock)) argument 116 #define write_trylock_irqsave(lock, flags) \ argument 122 __locked = write_trylock(lock); \ 148 #define rwlock_is_contended(lock) (((void)(lock), 0)) argument
|
| A D | ww_mutex.h | 108 static inline void ww_mutex_init(struct ww_mutex *lock, in ww_mutex_init() argument 112 lock->ctx = NULL; in ww_mutex_init() 114 lock->ww_class = ww_class; in ww_mutex_init() 313 ret = ww_mutex_lock(lock, ctx); in ww_mutex_lock_slow() 343 ww_mutex_lock_slow_interruptible(struct ww_mutex *lock, in ww_mutex_lock_slow_interruptible() argument 349 return ww_mutex_lock_interruptible(lock, ctx); in ww_mutex_lock_slow_interruptible() 352 extern void ww_mutex_unlock(struct ww_mutex *lock); 365 static inline void ww_mutex_destroy(struct ww_mutex *lock) in ww_mutex_destroy() argument 368 mutex_destroy(&lock->base); in ww_mutex_destroy() 378 static inline bool ww_mutex_is_locked(struct ww_mutex *lock) in ww_mutex_is_locked() argument [all …]
|
| /include/asm-generic/ |
| A D | qrwlock.h | 44 static inline int queued_read_trylock(struct qrwlock *lock) in queued_read_trylock() argument 48 cnts = atomic_read(&lock->cnts); in queued_read_trylock() 53 atomic_sub(_QR_BIAS, &lock->cnts); in queued_read_trylock() 67 cnts = atomic_read(&lock->cnts); in queued_write_trylock() 78 static inline void queued_read_lock(struct qrwlock *lock) in queued_read_lock() argument 82 cnts = atomic_add_return_acquire(_QR_BIAS, &lock->cnts); in queued_read_lock() 87 queued_read_lock_slowpath(lock); in queued_read_lock() 101 queued_write_lock_slowpath(lock); in queued_write_lock() 113 (void)atomic_sub_return_release(_QR_BIAS, &lock->cnts); in queued_read_unlock() 122 smp_store_release(&lock->wlocked, 0); in queued_write_unlock() [all …]
|
| A D | rqspinlock.h | 40 extern int resilient_tas_spin_lock(rqspinlock_t *lock); 179 grab_held_lock_entry(lock); in res_spin_lock() 187 #define res_spin_lock(lock) resilient_tas_spin_lock(lock) argument 216 smp_store_release(&lock->locked, 0); in res_spin_unlock() 221 #define raw_res_spin_lock_init(lock) ({ *(lock) = (rqspinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; }) argument 223 #define raw_res_spin_lock_init(lock) ({ *(lock) = (rqspinlock_t){0}; }) argument 230 __ret = res_spin_lock(lock); \ 236 #define raw_res_spin_unlock(lock) ({ res_spin_unlock(lock); preempt_enable(); }) argument 238 #define raw_res_spin_lock_irqsave(lock, flags) \ argument 242 __ret = raw_res_spin_lock(lock); \ [all …]
|
| A D | qspinlock.h | 51 static __always_inline int queued_spin_is_locked(struct qspinlock *lock) in queued_spin_is_locked() argument 57 return atomic_read(&lock->val); in queued_spin_is_locked() 73 return !lock.val.counter; in queued_spin_value_unlocked() 83 return atomic_read(&lock->val) & ~_Q_LOCKED_MASK; in queued_spin_is_contended() 90 static __always_inline int queued_spin_trylock(struct qspinlock *lock) in queued_spin_trylock() argument 92 int val = atomic_read(&lock->val); in queued_spin_trylock() 107 static __always_inline void queued_spin_lock(struct qspinlock *lock) in queued_spin_lock() argument 114 queued_spin_lock_slowpath(lock, val); in queued_spin_lock() 123 static __always_inline void queued_spin_unlock(struct qspinlock *lock) in queued_spin_unlock() argument 128 smp_store_release(&lock->locked, 0); in queued_spin_unlock() [all …]
|
| A D | ticket_spinlock.h | 33 static __always_inline void ticket_spin_lock(arch_spinlock_t *lock) in ticket_spin_lock() argument 35 u32 val = atomic_fetch_add(1<<16, &lock->val); in ticket_spin_lock() 49 atomic_cond_read_acquire(&lock->val, ticket == (u16)VAL); in ticket_spin_lock() 53 static __always_inline bool ticket_spin_trylock(arch_spinlock_t *lock) in ticket_spin_trylock() argument 55 u32 old = atomic_read(&lock->val); in ticket_spin_trylock() 63 static __always_inline void ticket_spin_unlock(arch_spinlock_t *lock) in ticket_spin_unlock() argument 65 u16 *ptr = (u16 *)lock + IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); in ticket_spin_unlock() 66 u32 val = atomic_read(&lock->val); in ticket_spin_unlock() 73 u32 val = lock.val.counter; in ticket_spin_value_unlocked() 80 arch_spinlock_t val = READ_ONCE(*lock); in ticket_spin_is_locked() [all …]
|
| /include/trace/events/ |
| A D | lock.h | 3 #define TRACE_SYSTEM lock 34 __string(name, lock->name) 50 DECLARE_EVENT_CLASS(lock, 54 TP_ARGS(lock, ip), 73 TP_ARGS(lock, ip) 82 TP_ARGS(lock, ip) 89 TP_ARGS(lock, ip) 99 TP_ARGS(lock, flags), 107 __entry->lock_addr = lock; 126 TP_ARGS(lock, ret), [all …]
|
| /include/asm-generic/bitops/ |
| A D | ext2-atomic.h | 9 #define ext2_set_bit_atomic(lock, nr, addr) \ argument 12 spin_lock(lock); \ 14 spin_unlock(lock); \ 18 #define ext2_clear_bit_atomic(lock, nr, addr) \ argument 21 spin_lock(lock); \ 23 spin_unlock(lock); \
|
| /include/acpi/platform/ |
| A D | aclinuxex.h | 81 spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ 82 if (lock) { \ 83 *(__handle) = lock; \ 86 lock ? AE_OK : AE_NO_MEMORY; \ 92 raw_spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ 93 if (lock) { \ 94 *(__handle) = lock; \ 97 lock ? AE_OK : AE_NO_MEMORY; \
|
| /include/drm/ |
| A D | drm_modeset_lock.h | 106 void drm_modeset_lock_init(struct drm_modeset_lock *lock); 112 static inline void drm_modeset_lock_fini(struct drm_modeset_lock *lock) in drm_modeset_lock_fini() argument 114 WARN_ON(!list_empty(&lock->head)); in drm_modeset_lock_fini() 121 static inline bool drm_modeset_is_locked(struct drm_modeset_lock *lock) in drm_modeset_is_locked() argument 123 return ww_mutex_is_locked(&lock->mutex); in drm_modeset_is_locked() 130 static inline void drm_modeset_lock_assert_held(struct drm_modeset_lock *lock) in drm_modeset_lock_assert_held() argument 132 lockdep_assert_held(&lock->mutex.base); in drm_modeset_lock_assert_held() 135 int drm_modeset_lock(struct drm_modeset_lock *lock, 137 int __must_check drm_modeset_lock_single_interruptible(struct drm_modeset_lock *lock); 138 void drm_modeset_unlock(struct drm_modeset_lock *lock);
|
| /include/linux/sched/ |
| A D | wake_q.h | 68 void raw_spin_unlock_wake(raw_spinlock_t *lock, struct wake_q_head *wake_q) in raw_spin_unlock_wake() argument 71 raw_spin_unlock(lock); in raw_spin_unlock_wake() 79 void raw_spin_unlock_irq_wake(raw_spinlock_t *lock, struct wake_q_head *wake_q) in raw_spin_unlock_irq_wake() argument 82 raw_spin_unlock_irq(lock); in raw_spin_unlock_irq_wake() 90 void raw_spin_unlock_irqrestore_wake(raw_spinlock_t *lock, unsigned long flags, in raw_spin_unlock_irqrestore_wake() argument 94 raw_spin_unlock_irqrestore(lock, flags); in raw_spin_unlock_irqrestore_wake()
|