mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
Add autoconf checks for atomic64_cmpxchg + atomic64_xchg
These functions didn't exist for all archs prior to 2.6.24. This
patch addes an autoconf test to detect this and add them when needed.
The autoconf check is needed instead of just an #ifndef because in
the most modern kernels atomic64_{cmp}xchg are implemented as in
inline function and not a #define.
This commit is contained in:
@@ -28,6 +28,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
|
||||
SPL_AC_ATOMIC_SPINLOCK
|
||||
SPL_AC_TYPE_UINTPTR_T
|
||||
SPL_AC_TYPE_ATOMIC64_T
|
||||
SPL_AC_TYPE_ATOMIC64_CMPXCHG
|
||||
SPL_AC_TYPE_ATOMIC64_XCHG
|
||||
SPL_AC_3ARGS_INIT_WORK
|
||||
SPL_AC_2ARGS_REGISTER_SYSCTL
|
||||
SPL_AC_SET_SHRINKER
|
||||
@@ -488,6 +490,44 @@ AC_DEFUN([SPL_AC_TYPE_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 <asm/atomic.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 <asm/atomic.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.20 API change,
|
||||
dnl # INIT_WORK use 2 args and not store data inside
|
||||
|
||||
Reference in New Issue
Block a user