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-Tag: v2.6.28-rc1~699^2^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=eceb1383361c6327cef4de01d278cd6722ebceeb;p=linux-2.6-omap-h63xx.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 8badab09146,93adae338ac,b5a4551fd56..157ff7fab97 --- 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