SPL_AC_DEBUG_KMEM_TRACKING
SPL_AC_TEST_MODULE
SPL_AC_ATOMIC_SPINLOCK
- SPL_AC_TYPE_ATOMIC64_CMPXCHG
- SPL_AC_TYPE_ATOMIC64_XCHG
SPL_AC_TYPE_UINTPTR_T
SPL_AC_SHRINKER_CALLBACK
SPL_AC_CTL_NAME
AC_MSG_RESULT([$have_atomic64_t])
])
-dnl #
-dnl # 2.6.24 API change,
-dnl # check if atomic64_cmpxchg is defined
-dnl #
-AC_DEFUN([SPL_AC_TYPE_ATOMIC64_CMPXCHG],
- [AC_MSG_CHECKING([whether kernel defines atomic64_cmpxchg])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- ],[
- atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
- ],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_ATOMIC64_CMPXCHG, 1,
- [kernel defines atomic64_cmpxchg])
- ],[
- AC_MSG_RESULT([no])
- ])
-])
-
-dnl #
-dnl # 2.6.24 API change,
-dnl # check if atomic64_xchg is defined
-dnl #
-AC_DEFUN([SPL_AC_TYPE_ATOMIC64_XCHG],
- [AC_MSG_CHECKING([whether kernel defines atomic64_xchg])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- ],[
- atomic64_xchg((atomic64_t *)NULL, 0);
- ],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_ATOMIC64_XCHG, 1,
- [kernel defines atomic64_xchg])
- ],[
- AC_MSG_RESULT([no])
- ])
-])
-
dnl #
dnl # 2.6.24 API change,
dnl # check if uintptr_t typedef is defined
#include <linux/spinlock.h>
#include <sys/types.h>
-#ifndef HAVE_ATOMIC64_CMPXCHG
-#define atomic64_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
-#endif
-
-#ifndef HAVE_ATOMIC64_XCHG
-#define atomic64_xchg(v, n) (xchg(&((v)->counter), n))
-#endif
-
/*
* Two approaches to atomic operations are implemented each with its
* own benefits are drawbacks imposed by the Solaris API. Neither