@@ -9,6 +9,8 @@
#ifndef _ARM_BITOPS_H
#define _ARM_BITOPS_H
+#include <xen/macros.h>
+
#include <asm/asm_defns.h>
/*
@@ -155,8 +157,8 @@ static inline int fls(unsigned int x)
}
-#define ffs(x) ({ unsigned int __t = (x); fls(__t & -__t); })
-#define ffsl(x) ({ unsigned long __t = (x); flsl(__t & -__t); })
+#define ffs(x) ({ unsigned int __t = (x); fls(LOWEST_BIT(__t)); })
+#define ffsl(x) ({ unsigned long __t = (x); flsl(LOWEST_BIT(__t)); })
/**
* find_first_set_bit - find the first set bit in @word