摘要:
linux内核中ffs(x)宏是平台相关的宏,在arm平台,该宏定义在arch/arm/include/asm/bitops.h#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })static inline int fls(int x){ int ret; if (__builtin_constant_p(x)) return constant_fls(x); asm("clz\t%0, %1" : "=r" (ret) : "r" (x) : " 阅读全文