to allow greater compatibility with kernels pre 2.6.16.
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@149
7e1ea52c-4ff2-0310-8f11-
9dd32ca42a1c
AC_MSG_RESULT(no)
])
])
+
+dnl #
+dnl # 2.6.16 API change.
+dnl # Check if 'fls64()' is available
+dnl #
+AC_DEFUN([SPL_AC_FLS64],
+ [AC_MSG_CHECKING([whether fls64() is available])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/bitops.h>
+ ],[
+ return fls64(0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FLS64, 1, [fls64() is available])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
SPL_AC_PATH_IN_NAMEIDATA
SPL_AC_TASK_CURR
SPL_AC_CTL_UNNUMBERED
+SPL_AC_FLS64
TOPDIR=`/bin/pwd`
--- /dev/null
+#ifndef _SPL_BITOPS_COMPAT_H
+#define _SPL_BITOPS_COMPAT_H
+
+#include <linux/bitops.h>
+
+#ifndef HAVE_FLS64
+
+static inline int fls64(__u64 x)
+{
+ __u32 h = x >> 32;
+ if (h)
+ return fls(h) + 32;
+ return fls(x);
+}
+
+#endif /* HAVE_FLS64 */
+
+#endif /* _SPL_BITOPS_COMPAT_H */
+