From 0c6abb58820398ac995305d88f3e6a9f0a692eb7 Mon Sep 17 00:00:00 2001 From: Andre McCurdy Date: Wed, 18 Apr 2018 17:40:59 -0700 Subject: remove a_ctz_l from arch specific atomic_arch.h Update atomic.h to provide a_ctz_l in all cases (atomic_arch.h should now only provide a_ctz_32 and/or a_ctz_64). The generic version of a_ctz_32 now takes advantage of a_clz_32 if available and the generic a_ctz_64 now makes use of a_ctz_32. --- arch/i386/atomic_arch.h | 6 +++--- arch/x32/atomic_arch.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/i386/atomic_arch.h b/arch/i386/atomic_arch.h index 7d2a48a5..047fb68d 100644 --- a/arch/i386/atomic_arch.h +++ b/arch/i386/atomic_arch.h @@ -92,10 +92,10 @@ static inline int a_ctz_64(uint64_t x) return r; } -#define a_ctz_l a_ctz_l -static inline int a_ctz_l(unsigned long x) +#define a_ctz_32 a_ctz_32 +static inline int a_ctz_32(uint32_t x) { - long r; + int r; __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) ); return r; } diff --git a/arch/x32/atomic_arch.h b/arch/x32/atomic_arch.h index a744c299..918c2d4e 100644 --- a/arch/x32/atomic_arch.h +++ b/arch/x32/atomic_arch.h @@ -106,8 +106,8 @@ static inline int a_ctz_64(uint64_t x) return x; } -#define a_ctz_l a_ctz_l -static inline int a_ctz_l(unsigned long x) +#define a_ctz_32 a_ctz_32 +static inline int a_ctz_32(uint32_t x) { __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) ); return x; -- cgit 1.4.1