/linux/include/linux/ |
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); 44 #define _raw_read_lock(lock) __raw_read_lock(lock) argument 48 #define _raw_write_lock(lock) __raw_write_lock(lock) argument 52 #define _raw_read_lock_bh(lock) __raw_read_lock_bh(lock) argument 56 #define _raw_write_lock_bh(lock) __raw_write_lock_bh(lock) argument 60 #define _raw_read_lock_irq(lock) __raw_read_lock_irq(lock) argument 76 #define _raw_read_trylock(lock) __raw_read_trylock(lock) argument 80 #define _raw_write_trylock(lock) __raw_write_trylock(lock) argument 84 #define _raw_read_unlock(lock) __raw_read_unlock(lock) argument [all …]
|
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 62 #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) argument 63 #define _raw_read_lock_bh(lock) __LOCK_BH(lock) argument 64 #define _raw_write_lock_bh(lock) __LOCK_BH(lock) argument 75 #define _raw_spin_unlock(lock) __UNLOCK(lock) argument 76 #define _raw_read_unlock(lock) __UNLOCK(lock) argument [all …]
|
A D | spinlock.h | 106 __raw_spin_lock_init((lock), #lock, &__key, LD_WAIT_SPIN); \ 111 do { *(lock) = __RAW_SPIN_LOCK_UNLOCKED(lock); } while (0) 119 #define raw_spin_is_contended(lock) (((void)(lock), 0)) argument 213 #define raw_spin_trylock(lock) __cond_lock(lock, _raw_spin_trylock(lock)) argument 215 #define raw_spin_lock(lock) _raw_spin_lock(lock) argument 272 #define raw_spin_lock_irq(lock) _raw_spin_lock_irq(lock) argument 273 #define raw_spin_lock_bh(lock) _raw_spin_lock_bh(lock) argument 274 #define raw_spin_unlock(lock) _raw_spin_unlock(lock) argument 282 #define raw_spin_unlock_bh(lock) _raw_spin_unlock_bh(lock) argument 285 __cond_lock(lock, _raw_spin_trylock_bh(lock)) [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 86 #define read_lock_irq(lock) _raw_read_lock_irq(lock) argument 87 #define read_lock_bh(lock) _raw_read_lock_bh(lock) argument 90 #define read_unlock(lock) _raw_read_unlock(lock) argument 91 #define write_unlock(lock) _raw_write_unlock(lock) argument [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 | 45 rt_spin_lock(lock); in spin_lock() 89 rt_spin_lock(lock); in spin_lock_bh() 94 rt_spin_lock(lock); in spin_lock_irq() 106 rt_spin_unlock(lock); in spin_unlock() 127 __cond_lock(lock, rt_spin_trylock(lock)) 130 __cond_lock(lock, rt_spin_trylock_bh(lock)) 133 __cond_lock(lock, rt_spin_trylock(lock)) 146 __cond_lock(lock, __spin_trylock_irqsave(lock, flags)) 148 #define spin_is_contended(lock) (((void)(lock), 0)) argument 152 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 | 83 extern void mutex_destroy(struct mutex *lock); 187 #define mutex_lock(lock) mutex_lock_nested(lock, 0) argument 188 #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) argument 189 #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) argument 190 #define mutex_lock_io(lock) mutex_lock_io_nested(lock, 0) argument 199 extern void mutex_lock(struct mutex *lock); 204 # define mutex_lock_nested(lock, subclass) mutex_lock(lock) argument 205 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) argument 206 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) argument 207 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) argument [all …]
|
A D | lockdep.h | 233 lockdep_init_map_waits(&(lock)->dep_map, #lock, (lock)->dep_map.key, sub,\ 238 lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock) 243 #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key) argument 248 return lock->key == key; in lockdep_match_key() 286 #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map) argument 287 #define lockdep_is_held_type(lock, r) lock_is_held_type(&(lock)->dep_map, (r)) argument 296 lock_set_class(lock, lock->name, lock->key, subclass, ip); in lock_set_subclass() 454 lock(_lock); \ 464 ____err = lock(_lock); \ 477 lock(_lock) [all …]
|
/linux/kernel/locking/ |
A D | spinlock_debug.c | 23 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in __raw_spin_lock_init() 42 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in __rwlock_init() 65 lock, READ_ONCE(lock->magic), in spin_dump() 99 SPIN_BUG_ON(lock->magic != SPINLOCK_MAGIC, lock, "bad magic"); in debug_spin_unlock() 101 SPIN_BUG_ON(lock->owner != current, lock, "wrong owner"); in debug_spin_unlock() 160 RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); in do_raw_read_lock() 179 RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); in do_raw_read_unlock() 185 RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); in debug_write_lock_before() 186 RWLOCK_BUG_ON(lock->owner == current, lock, "recursion"); in debug_write_lock_before() 199 RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); in debug_write_unlock() [all …]
|
A D | mutex.c | 49 osq_lock_init(&lock->osq); in __mutex_init() 493 osq_unlock(&lock->osq); in mutex_optimistic_spin() 500 osq_unlock(&lock->osq); in mutex_optimistic_spin() 564 __ww_mutex_unlock(lock); in ww_mutex_unlock() 586 MUTEX_WARN_ON(lock->magic != lock); in __mutex_lock_common() 639 __mutex_add_waiter(lock, &waiter, &lock->wait_list); in __mutex_lock_common() 849 ww_mutex_unlock(lock); in ww_mutex_deadlock_injection() 1020 mutex_lock(lock); in mutex_lock_io() 1078 MUTEX_WARN_ON(lock->magic != lock); in mutex_trylock() 1135 mutex_lock(lock); in atomic_dec_and_mutex_lock() [all …]
|
A D | rtmutex_api.c | 119 __rt_mutex_unlock(&lock->rtmutex); in rt_mutex_unlock() 148 debug_rt_mutex_unlock(lock); in __rt_mutex_futex_unlock() 151 lock->owner = NULL; in __rt_mutex_futex_unlock() 194 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in __rt_mutex_init() 219 __rt_mutex_base_init(lock); in rt_mutex_init_proxy_locked() 248 rt_mutex_set_owner(lock, NULL); in rt_mutex_proxy_unlock() 326 remove_waiter(lock, waiter); in rt_mutex_start_proxy_lock() 363 fixup_rt_mutex_waiters(lock); in rt_mutex_wait_proxy_lock() 412 remove_waiter(lock, waiter); in rt_mutex_cleanup_proxy_lock() 419 fixup_rt_mutex_waiters(lock); in rt_mutex_cleanup_proxy_lock() [all …]
|
A D | spinlock.c | 154 __raw_spin_lock(lock); in _raw_spin_lock() 170 __raw_spin_lock_irq(lock); in _raw_spin_lock_irq() 178 __raw_spin_lock_bh(lock); in _raw_spin_lock_bh() 186 __raw_spin_unlock(lock); in _raw_spin_unlock() 228 __raw_read_lock(lock); in _raw_read_lock() 244 __raw_read_lock_irq(lock); in _raw_read_lock_irq() 252 __raw_read_lock_bh(lock); in _raw_read_lock_bh() 260 __raw_read_unlock(lock); in _raw_read_unlock() 300 __raw_write_lock(lock); in _raw_write_lock() 324 __raw_write_lock_bh(lock); in _raw_write_lock_bh() [all …]
|
A D | rtmutex.c | 34 struct rt_mutex *lock, in __ww_mutex_add_waiter() argument 219 __releases(lock->wait_lock) in unlock_rt_mutex_safe() 279 __releases(lock->wait_lock) in unlock_rt_mutex_safe() 281 lock->owner = NULL; in unlock_rt_mutex_safe() 584 struct rt_mutex_base *lock; in rt_mutex_adjust_prio_chain() local 730 lock = waiter->lock; in rt_mutex_adjust_prio_chain() 751 if (lock == orig_lock || rt_mutex_owner(lock) == top_task) { in rt_mutex_adjust_prio_chain() 996 if (rt_mutex_owner(lock)) in try_to_take_rt_mutex() 1112 waiter->lock = lock; in task_blocks_on_rt_mutex() 1259 if (rt_mutex_owner(lock)) in rt_mutex_slowtrylock() [all …]
|
A D | ww_mutex.h | 9 __ww_waiter_first(struct mutex *lock) in __ww_waiter_first() argument 41 __ww_waiter_last(struct mutex *lock) in __ww_waiter_last() argument 64 return __mutex_owner(lock); in __ww_mutex_owner() 75 raw_spin_lock(&lock->wait_lock); in lock_wait_lock() 407 lock_wait_lock(&lock->base); in ww_mutex_set_context_fastpath() 409 unlock_wait_lock(&lock->base); in ww_mutex_set_context_fastpath() 490 struct MUTEX *lock, in __ww_mutex_add_waiter() argument 561 if (lock->ctx) { in __ww_mutex_unlock() 565 if (lock->ctx->acquired > 0) in __ww_mutex_unlock() 566 lock->ctx->acquired--; in __ww_mutex_unlock() [all …]
|
/linux/drivers/md/persistent-data/ |
A D | dm-block-manager.c | 196 spin_lock(&lock->lock); in bl_down_read() 199 spin_unlock(&lock->lock); in bl_down_read() 215 spin_unlock(&lock->lock); in bl_down_read() 226 spin_lock(&lock->lock); in bl_down_read_nonblock() 239 spin_unlock(&lock->lock); in bl_down_read_nonblock() 245 spin_lock(&lock->lock); in bl_up_read() 251 spin_unlock(&lock->lock); in bl_up_read() 259 spin_lock(&lock->lock); in bl_down_write() 282 spin_unlock(&lock->lock); in bl_down_write() 292 spin_lock(&lock->lock); in bl_up_write() [all …]
|
/linux/drivers/gpu/drm/ |
A D | drm_lock.c | 63 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_lock_take() local 67 old = *lock; in drm_lock_take() 112 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_lock_transfer() local 116 old = *lock; in drm_lock_transfer() 127 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_legacy_lock_free() local 139 old = *lock; in drm_legacy_lock_free() 185 master->lock.hw_lock ? master->lock.hw_lock->lock : -1, in drm_legacy_lock() 201 if (drm_lock_take(&master->lock, lock->context)) { in drm_legacy_lock() 231 dev->sigdata.lock = master->lock.hw_lock; in drm_legacy_lock() 335 _DRM_LOCK_IS_HELD(master->lock.hw_lock->lock) && in drm_legacy_i_have_hw_lock() [all …]
|
/linux/fs/ocfs2/dlm/ |
A D | dlmast.c | 79 BUG_ON(!lock); in __dlm_queue_ast() 81 res = lock->lockres; in __dlm_queue_ast() 91 lock->ast_pending, lock->ml.type); in __dlm_queue_ast() 101 dlm_lock_get(lock); in __dlm_queue_ast() 132 BUG_ON(!lock); in dlm_queue_ast() 145 BUG_ON(!lock); in __dlm_queue_bast() 206 fn = lock->ast; in dlm_do_local_ast() 226 lksb = lock->lksb; in dlm_do_remote_ast() 346 lock = NULL; in dlm_proxy_ast_handler() 387 lock->ml.type, lock->ml.convert_type); in dlm_proxy_ast_handler() [all …]
|
A D | dlmlock.c | 87 lock->ml.type)) in dlm_can_grant_new_lock() 129 dlm_lock_get(lock); in dlmlock_master() 412 if (!lock) in dlm_new_lock() 430 return lock; in dlm_new_lock() 587 if (!lock) { in dlmlock() 606 if (lock->lksb != lksb || lock->ast != ast || in dlmlock() 607 lock->bast != bast || lock->astdata != data) { in dlmlock() 612 "astdata=%p\n", lock->lksb, lock->ast, in dlmlock() 613 lock->bast, lock->astdata); in dlmlock() 652 if (!lock) { in dlmlock() [all …]
|
/linux/arch/alpha/include/asm/ |
A D | spinlock.h | 21 return lock.lock == 0; in arch_spin_value_unlocked() 27 lock->lock = 0; in arch_spin_unlock() 46 : "=&r" (tmp), "=m" (lock->lock) in arch_spin_lock() 47 : "m"(lock->lock) : "memory"); in arch_spin_lock() 52 return !test_and_set_bit(0, &lock->lock); in arch_spin_trylock() 74 : "m" (*lock) : "memory"); in arch_read_lock() 94 : "m" (*lock) : "memory"); in arch_write_lock() 114 : "m" (*lock) : "memory"); in arch_read_trylock() 136 : "m" (*lock) : "memory"); in arch_write_trylock() 154 : "m" (*lock) : "memory"); in arch_read_unlock() [all …]
|
/linux/arch/ia64/include/asm/ |
A D | spinlock.h | 45 int *p = (int *)&lock->lock, ticket, serve; in __ticket_spin_lock() 65 int tmp = READ_ONCE(lock->lock); in __ticket_spin_trylock() 68 return ia64_cmpxchg(acq, &lock->lock, tmp, tmp + 1, sizeof (tmp)) == tmp; in __ticket_spin_trylock() 74 unsigned short *p = (unsigned short *)&lock->lock + 1, tmp; in __ticket_spin_unlock() 84 long tmp = READ_ONCE(lock->lock); in __ticket_spin_is_locked() 91 long tmp = READ_ONCE(lock->lock); in __ticket_spin_is_contended() 98 return !(((lock.lock >> TICKET_SHIFT) ^ lock.lock) & TICKET_MASK); in arch_spin_value_unlocked() 114 __ticket_spin_lock(lock); in arch_spin_lock() 256 arch_rwlock_t lock; in arch_read_trylock() member 259 old.lock = new.lock = *x; in arch_read_trylock() [all …]
|
/linux/arch/hexagon/include/asm/ |
A D | spinlock.h | 28 static inline void arch_read_lock(arch_rwlock_t *lock) in arch_read_lock() argument 37 : "r" (&lock->lock) in arch_read_lock() 51 : "r" (&lock->lock) in arch_read_unlock() 69 : "r" (&lock->lock) in arch_read_trylock() 85 : "r" (&lock->lock) in arch_write_lock() 102 : "r" (&lock->lock) in arch_write_trylock() 112 lock->lock = 0; in arch_write_unlock() 124 : "r" (&lock->lock) in arch_spin_lock() 133 lock->lock = 0; in arch_spin_unlock() 147 : "r" (&lock->lock) in arch_spin_trylock() [all …]
|
/linux/arch/riscv/include/asm/ |
A D | spinlock.h | 24 smp_store_release(&lock->lock, 0); in arch_spin_unlock() 34 : "=r" (busy), "+A" (lock->lock) in arch_spin_trylock() 44 if (arch_spin_is_locked(lock)) in arch_spin_lock() 47 if (arch_spin_trylock(lock)) in arch_spin_lock() 54 static inline void arch_read_lock(arch_rwlock_t *lock) in arch_read_lock() argument 65 : "+A" (lock->lock), "=&r" (tmp) in arch_read_lock() 80 : "+A" (lock->lock), "=&r" (tmp) in arch_write_lock() 96 : "+A" (lock->lock), "=&r" (busy) in arch_read_trylock() 114 : "+A" (lock->lock), "=&r" (busy) in arch_write_trylock() 125 : "+A" (lock->lock) in arch_read_unlock() [all …]
|
/linux/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/ |
A D | locks.h | 49 pthread_mutex_init(&lock->mutex, NULL); in lock_impl_init() 68 bool old_locked = lock->locked; in lock_impl_trylock() 69 lock->locked = true; in lock_impl_trylock() 85 assume(lock_impl_trylock(lock)); in lock_impl_lock() 102 bool old_locked = lock->locked; in lock_impl_unlock() 103 lock->locked = false; in lock_impl_unlock() 112 lock->locked = false; in lock_impl_init() 157 #define spin_lock_irq(lock) spin_lock(lock) argument 158 #define spin_unlock_irq(lock) spin_unlock(lock) argument 159 #define spin_lock_irqsave(lock, flags) spin_lock(lock) argument [all …]
|
/linux/arch/powerpc/include/asm/ |
A D | simple_spinlock.h | 36 return lock.slock == 0; in arch_spin_value_unlocked() 99 splpar_spin_yield(lock); in spin_yield() 107 splpar_rw_yield(lock); in rw_yield() 120 splpar_spin_yield(lock); in arch_spin_lock() 130 lock->slock = 0; in arch_spin_unlock() 169 : "r" (&rw->lock) in __arch_read_trylock() 248 : "r"(&rw->lock) in arch_read_unlock() 256 rw->lock = 0; in arch_write_unlock() 259 #define arch_spin_relax(lock) spin_yield(lock) argument 260 #define arch_read_relax(lock) rw_yield(lock) argument [all …]
|