Lines Matching +full:full +full:- +full:custom
1 /* SPDX-License-Identifier: GPL-2.0 */
4 * 'Generic' ticket-lock implementation.
8 * to a test-and-set lock.
11 * sub-word of the value. This is generally true for anything LL/SC although
14 * a test-and-set.
18 * a full fence after the spin to upgrade the otherwise-RCpc
31 #include <asm-generic/spinlock_types.h>
35 u32 val = atomic_fetch_add(1<<16, &lock->val); in ticket_spin_lock()
43 * custom cond_read_rcsc() here we just emit a full fence. We only in ticket_spin_lock()
49 atomic_cond_read_acquire(&lock->val, ticket == (u16)VAL); in ticket_spin_lock()
55 u32 old = atomic_read(&lock->val); in ticket_spin_trylock()
60 return atomic_try_cmpxchg(&lock->val, &old, old + (1<<16)); /* SC, for RCsc */ in ticket_spin_trylock()
66 u32 val = atomic_read(&lock->val); in ticket_spin_unlock()
87 u32 val = atomic_read(&lock->val); in ticket_spin_is_contended()
89 return (s16)((val >> 16) - (val & 0xffff)) > 1; in ticket_spin_is_contended()