From: Ingo Molnar Date: Sun, 12 Oct 2008 11:20:25 +0000 (+0200) Subject: Merge branches 'core/signal' and 'x86/spinlocks' into x86/xen X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eceb1383361c6327cef4de01d278cd6722ebceeb;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge branches 'core/signal' and 'x86/spinlocks' into x86/xen Conflicts: include/asm-x86/spinlock.h --- eceb1383361c6327cef4de01d278cd6722ebceeb diff --cc include/asm-x86/spinlock.h index 8badab09146b,93adae338ac6,b5a4551fd565..157ff7fab97a --- a/include/asm-x86/spinlock.h +++ b/include/asm-x86/spinlock.h @@@@ -182,6 -182,8 -158,22 +158,20 @@@@ static __always_inline void __ticket_sp } #endif - #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) ++ static inline int __ticket_spin_is_locked(raw_spinlock_t *lock) ++ { ++ int tmp = ACCESS_ONCE(lock->slock); ++ ++ return !!(((tmp >> TICKET_SHIFT) ^ tmp) & ((1 << TICKET_SHIFT) - 1)); ++ } ++ ++ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock) ++ { ++ int tmp = ACCESS_ONCE(lock->slock); ++ ++ return (((tmp >> TICKET_SHIFT) - tmp) & ((1 << TICKET_SHIFT) - 1)) > 1; ++ } + -#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) - #ifdef CONFIG_PARAVIRT /* * Define virtualization-friendly old-style lock byte lock, for use in