X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=arch%2Fi386%2Fatomic.h;h=66059af9a45b90a5ff418eed6eb6d203776acd4a;hb=4bb9b4f3b4a6794da3091f58acbd938ff66fc15b;hp=bf3c336e6e30ceda2aca4d63ee257e0dc9b65f66;hpb=e914f8b7ec79f622fa3b017af434642f61d45ce8;p=musl diff --git a/arch/i386/atomic.h b/arch/i386/atomic.h index bf3c336e..66059af9 100644 --- a/arch/i386/atomic.h +++ b/arch/i386/atomic.h @@ -1,5 +1,5 @@ -#ifndef _INTERNAA_ATOMIC_H -#define _INTERNAA_ATOMIC_H +#ifndef _INTERNAL_ATOMIC_H +#define _INTERNAL_ATOMIC_H #include @@ -11,6 +11,12 @@ static inline int a_ctz_64(uint64_t x) return r; } +static inline int a_ctz_l(unsigned long x) +{ + long r; + __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) ); + return r; +} static inline void a_and_64(volatile uint64_t *p, uint64_t v) {