summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/atomic_arch.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/atomic_arch.h b/arch/powerpc/atomic_arch.h
index f31566b2..5b65cde7 100644
--- a/arch/powerpc/atomic_arch.h
+++ b/arch/powerpc/atomic_arch.h
@@ -37,3 +37,10 @@ static inline void a_store(volatile int *p, int v)
*p = v;
a_post_llsc();
}
+
+#define a_clz_32 a_clz_32
+static inline int a_clz_32(uint32_t x)
+{
+ __asm__ ("cntlzw %0, %1" : "=r"(x) : "r"(x));
+ return x;
+}