diff options
Diffstat (limited to 'arch/x86/include/asm/qspinlock.h')
-rw-r--r-- | arch/x86/include/asm/qspinlock.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h index 87623c6b13db..bd5ac6cc37db 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h | |||
@@ -13,12 +13,15 @@ | |||
13 | #define queued_fetch_set_pending_acquire queued_fetch_set_pending_acquire | 13 | #define queued_fetch_set_pending_acquire queued_fetch_set_pending_acquire |
14 | static __always_inline u32 queued_fetch_set_pending_acquire(struct qspinlock *lock) | 14 | static __always_inline u32 queued_fetch_set_pending_acquire(struct qspinlock *lock) |
15 | { | 15 | { |
16 | u32 val = 0; | 16 | u32 val; |
17 | |||
18 | if (GEN_BINARY_RMWcc(LOCK_PREFIX "btsl", lock->val.counter, c, | ||
19 | "I", _Q_PENDING_OFFSET)) | ||
20 | val |= _Q_PENDING_VAL; | ||
21 | 17 | ||
18 | /* | ||
19 | * We can't use GEN_BINARY_RMWcc() inside an if() stmt because asm goto | ||
20 | * and CONFIG_PROFILE_ALL_BRANCHES=y results in a label inside a | ||
21 | * statement expression, which GCC doesn't like. | ||
22 | */ | ||
23 | val = GEN_BINARY_RMWcc(LOCK_PREFIX "btsl", lock->val.counter, c, | ||
24 | "I", _Q_PENDING_OFFSET) * _Q_PENDING_VAL; | ||
22 | val |= atomic_read(&lock->val) & ~_Q_PENDING_MASK; | 25 | val |= atomic_read(&lock->val) & ~_Q_PENDING_MASK; |
23 | 26 | ||
24 | return val; | 27 | return val; |