Lines Matching refs:lock

22 #define arch_spin_lock_init(x)			((x)->lock = 0)
43 static __always_inline void __ticket_spin_lock(arch_spinlock_t *lock) in __ticket_spin_lock() argument
45 int *p = (int *)&lock->lock, ticket, serve; in __ticket_spin_lock()
63 static __always_inline int __ticket_spin_trylock(arch_spinlock_t *lock) in __ticket_spin_trylock() argument
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()
72 static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock) in __ticket_spin_unlock() argument
74 unsigned short *p = (unsigned short *)&lock->lock + 1, tmp; in __ticket_spin_unlock()
82 static inline int __ticket_spin_is_locked(arch_spinlock_t *lock) in __ticket_spin_is_locked() argument
84 long tmp = READ_ONCE(lock->lock); in __ticket_spin_is_locked()
89 static inline int __ticket_spin_is_contended(arch_spinlock_t *lock) in __ticket_spin_is_contended() argument
91 long tmp = READ_ONCE(lock->lock); in __ticket_spin_is_contended()
96 static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) in arch_spin_value_unlocked() argument
98 return !(((lock.lock >> TICKET_SHIFT) ^ lock.lock) & TICKET_MASK); in arch_spin_value_unlocked()
101 static inline int arch_spin_is_locked(arch_spinlock_t *lock) in arch_spin_is_locked() argument
103 return __ticket_spin_is_locked(lock); in arch_spin_is_locked()
106 static inline int arch_spin_is_contended(arch_spinlock_t *lock) in arch_spin_is_contended() argument
108 return __ticket_spin_is_contended(lock); in arch_spin_is_contended()
112 static __always_inline void arch_spin_lock(arch_spinlock_t *lock) in arch_spin_lock() argument
114 __ticket_spin_lock(lock); in arch_spin_lock()
117 static __always_inline int arch_spin_trylock(arch_spinlock_t *lock) in arch_spin_trylock() argument
119 return __ticket_spin_trylock(lock); in arch_spin_trylock()
122 static __always_inline void arch_spin_unlock(arch_spinlock_t *lock) in arch_spin_unlock() argument
124 __ticket_spin_unlock(lock); in arch_spin_unlock()
130 arch_read_lock(arch_rwlock_t *lock) in arch_read_lock() argument
151 : : "r"(lock), "r"(flags), "i"(IA64_PSR_I_BIT) in arch_read_lock()
179 arch_write_lock(arch_rwlock_t *lock) in arch_write_lock() argument
201 : : "r"(lock), "r"(flags), "i"(IA64_PSR_I_BIT) in arch_write_lock()
256 arch_rwlock_t lock; in arch_read_trylock() member
259 old.lock = new.lock = *x; in arch_read_trylock()
260 old.lock.write_lock = new.lock.write_lock = 0; in arch_read_trylock()
261 ++new.lock.read_counter; in arch_read_trylock()