Lines Matching refs:lock
101 extern void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name,
104 # define raw_spin_lock_init(lock) \ argument
108 __raw_spin_lock_init((lock), #lock, &__key, LD_WAIT_SPIN); \
112 # define raw_spin_lock_init(lock) \ argument
113 do { *(lock) = __RAW_SPIN_LOCK_UNLOCKED(lock); } while (0)
116 #define raw_spin_is_locked(lock) arch_spin_is_locked(&(lock)->raw_lock) argument
119 #define raw_spin_is_contended(lock) arch_spin_is_contended(&(lock)->raw_lock) argument
121 #define raw_spin_is_contended(lock) (((void)(lock), 0)) argument
180 extern void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock);
181 extern int do_raw_spin_trylock(raw_spinlock_t *lock);
182 extern void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock);
184 static inline void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock) in do_raw_spin_lock() argument
186 __acquire(lock); in do_raw_spin_lock()
187 arch_spin_lock(&lock->raw_lock); in do_raw_spin_lock()
191 static inline int do_raw_spin_trylock(raw_spinlock_t *lock) in do_raw_spin_trylock() argument
193 int ret = arch_spin_trylock(&(lock)->raw_lock); in do_raw_spin_trylock()
201 static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) in do_raw_spin_unlock() argument
204 arch_spin_unlock(&lock->raw_lock); in do_raw_spin_unlock()
205 __release(lock); in do_raw_spin_unlock()
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
220 # define raw_spin_lock_nested(lock, subclass) \ argument
221 _raw_spin_lock_nested(lock, subclass)
223 # define raw_spin_lock_nest_lock(lock, nest_lock) \ argument
226 _raw_spin_lock_nest_lock(lock, &(nest_lock)->dep_map); \
234 # define raw_spin_lock_nested(lock, subclass) \ argument
235 _raw_spin_lock(((void)(subclass), (lock)))
236 # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) argument
241 #define raw_spin_lock_irqsave(lock, flags) \ argument
244 flags = _raw_spin_lock_irqsave(lock); \
248 #define raw_spin_lock_irqsave_nested(lock, flags, subclass) \ argument
251 flags = _raw_spin_lock_irqsave_nested(lock, subclass); \
254 #define raw_spin_lock_irqsave_nested(lock, flags, subclass) \ argument
257 flags = _raw_spin_lock_irqsave(lock); \
263 #define raw_spin_lock_irqsave(lock, flags) \ argument
266 _raw_spin_lock_irqsave(lock, flags); \
269 #define raw_spin_lock_irqsave_nested(lock, flags, subclass) \ argument
270 raw_spin_lock_irqsave(lock, flags)
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
277 #define raw_spin_unlock_irq(lock) _raw_spin_unlock_irq(lock) argument
279 #define raw_spin_unlock_irqrestore(lock, flags) \ argument
282 _raw_spin_unlock_irqrestore(lock, flags); \
284 #define raw_spin_unlock_bh(lock) _raw_spin_unlock_bh(lock) argument
286 #define raw_spin_trylock_bh(lock) \ argument
287 __cond_lock(lock, _raw_spin_trylock_bh(lock))
289 #define raw_spin_trylock_irq(lock) \ argument
292 raw_spin_trylock(lock) ? \
296 #define raw_spin_trylock_irqsave(lock, flags) \ argument
299 raw_spin_trylock(lock) ? \
324 static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock) in spinlock_check() argument
326 return &lock->rlock; in spinlock_check()
331 # define spin_lock_init(lock) \ argument
335 __raw_spin_lock_init(spinlock_check(lock), \
336 #lock, &__key, LD_WAIT_CONFIG); \
349 static __always_inline void spin_lock(spinlock_t *lock) in spin_lock() argument
351 raw_spin_lock(&lock->rlock); in spin_lock()
354 static __always_inline void spin_lock_bh(spinlock_t *lock) in spin_lock_bh() argument
356 raw_spin_lock_bh(&lock->rlock); in spin_lock_bh()
359 static __always_inline int spin_trylock(spinlock_t *lock) in spin_trylock() argument
361 return raw_spin_trylock(&lock->rlock); in spin_trylock()
364 #define spin_lock_nested(lock, subclass) \ argument
366 raw_spin_lock_nested(spinlock_check(lock), subclass); \
369 #define spin_lock_nest_lock(lock, nest_lock) \ argument
371 raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \
374 static __always_inline void spin_lock_irq(spinlock_t *lock) in spin_lock_irq() argument
376 raw_spin_lock_irq(&lock->rlock); in spin_lock_irq()
379 #define spin_lock_irqsave(lock, flags) \ argument
381 raw_spin_lock_irqsave(spinlock_check(lock), flags); \
384 #define spin_lock_irqsave_nested(lock, flags, subclass) \ argument
386 raw_spin_lock_irqsave_nested(spinlock_check(lock), flags, subclass); \
389 static __always_inline void spin_unlock(spinlock_t *lock) in spin_unlock() argument
391 raw_spin_unlock(&lock->rlock); in spin_unlock()
394 static __always_inline void spin_unlock_bh(spinlock_t *lock) in spin_unlock_bh() argument
396 raw_spin_unlock_bh(&lock->rlock); in spin_unlock_bh()
399 static __always_inline void spin_unlock_irq(spinlock_t *lock) in spin_unlock_irq() argument
401 raw_spin_unlock_irq(&lock->rlock); in spin_unlock_irq()
404 static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) in spin_unlock_irqrestore() argument
406 raw_spin_unlock_irqrestore(&lock->rlock, flags); in spin_unlock_irqrestore()
409 static __always_inline int spin_trylock_bh(spinlock_t *lock) in spin_trylock_bh() argument
411 return raw_spin_trylock_bh(&lock->rlock); in spin_trylock_bh()
414 static __always_inline int spin_trylock_irq(spinlock_t *lock) in spin_trylock_irq() argument
416 return raw_spin_trylock_irq(&lock->rlock); in spin_trylock_irq()
419 #define spin_trylock_irqsave(lock, flags) \ argument
421 raw_spin_trylock_irqsave(spinlock_check(lock), flags); \
442 static __always_inline int spin_is_locked(spinlock_t *lock) in spin_is_locked() argument
444 return raw_spin_is_locked(&lock->rlock); in spin_is_locked()
447 static __always_inline int spin_is_contended(spinlock_t *lock) in spin_is_contended() argument
449 return raw_spin_is_contended(&lock->rlock); in spin_is_contended()
452 #define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock) argument
471 extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
472 #define atomic_dec_and_lock(atomic, lock) \ argument
473 __cond_lock(lock, _atomic_dec_and_lock(atomic, lock))
475 extern int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock,
477 #define atomic_dec_and_lock_irqsave(atomic, lock, flags) \ argument
478 __cond_lock(lock, _atomic_dec_and_lock_irqsave(atomic, lock, &(flags)))
480 extern int _atomic_dec_and_raw_lock(atomic_t *atomic, raw_spinlock_t *lock);
481 #define atomic_dec_and_raw_lock(atomic, lock) \ argument
482 __cond_lock(lock, _atomic_dec_and_raw_lock(atomic, lock))
484 extern int _atomic_dec_and_raw_lock_irqsave(atomic_t *atomic, raw_spinlock_t *lock,
486 #define atomic_dec_and_raw_lock_irqsave(atomic, lock, flags) \ argument
487 __cond_lock(lock, _atomic_dec_and_raw_lock_irqsave(atomic, lock, &(flags)))
507 raw_spin_lock(_T->lock),
508 raw_spin_unlock(_T->lock))
511 raw_spin_lock_nested(_T->lock, SINGLE_DEPTH_NESTING),
512 raw_spin_unlock(_T->lock))
515 raw_spin_lock_irq(_T->lock),
516 raw_spin_unlock_irq(_T->lock))
519 raw_spin_lock_irqsave(_T->lock, _T->flags),
520 raw_spin_unlock_irqrestore(_T->lock, _T->flags),
524 spin_lock(_T->lock),
525 spin_unlock(_T->lock))
528 spin_lock_irq(_T->lock),
529 spin_unlock_irq(_T->lock))
532 spin_lock_irqsave(_T->lock, _T->flags),
533 spin_unlock_irqrestore(_T->lock, _T->flags),