From a5e8d6ad4571699026fc9975735d1fa024a818c8 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Tue, 21 May 2013 19:53:44 -0400 Subject: [PATCH] ck_spinlock: Only enable trylock for ck_spinlock_ticket on x86*. trylock algorithm semantics are not cleanly defined outside of x86. --- include/ck_spinlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ck_spinlock.h b/include/ck_spinlock.h index 323de5c..b78051b 100644 --- a/include/ck_spinlock.h +++ b/include/ck_spinlock.h @@ -408,9 +408,9 @@ ck_spinlock_dec_unlock(struct ck_spinlock_dec *lock) /* * If 16-bit or 32-bit increment is supported, implement support for * trylock functionality on availability of 32-bit or 64-bit fetch-and-add - * and compare-and-swap. + * and compare-and-swap. This code path is only applied to x86*. */ -#if defined(CK_MD_TSO) +#if defined(CK_MD_TSO) && (defined(__x86__) || defined(__x86_64__)) #if defined(CK_F_PR_FAA_32) && defined(CK_F_PR_INC_16) && defined(CK_F_PR_CAS_32) #define CK_SPINLOCK_TICKET_TYPE uint32_t #define CK_SPINLOCK_TICKET_TYPE_BASE uint16_t