summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-06-24 11:57:14 -0700
committerBrian Behlendorf <[email protected]>2011-06-24 13:00:08 -0700
commit86fd39f354778eb10e77a7c1660b59ca16ffcc16 (patch)
treeddba0bbdcc45babd1863a732c96bc475a19251a7 /configure
parent79593b0dec57ee94c5bb56cdc2770ebde81ecea9 (diff)
Linux 2.6.39 compat, mutex owner
Prior to Linux 2.6.39 when CONFIG_DEBUG_MUTEXES was defined the kernel stored a thread_info pointer as the mutex owner. From this you could get the pointer of the current task_struct to compare with get_current(). As of Linux 2.6.39 this behavior has changed and now the mutex stores a pointer to the task_struct. This commit detects the type of pointer stored in the mutex and adjusts the mutex_owner() and mutex_owned() functions to perform the correct comparision.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure138
1 files changed, 138 insertions, 0 deletions
diff --git a/configure b/configure
index c537b9817..cf396e484 100755
--- a/configure
+++ b/configure
@@ -13687,6 +13687,75 @@ fi
+ { $as_echo "$as_me:$LINENO: checking whether struct mutex owner is a task_struct" >&5
+$as_echo_n "checking whether struct mutex owner is a task_struct... " >&6; }
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+ #include <linux/mutex.h>
+
+int
+main (void)
+{
+
+ struct mutex mtx __attribute__ ((unused));
+ mtx.owner = current;
+
+ ;
+ return 0;
+}
+
+_ACEOF
+
+
+ rm -Rf build && mkdir -p build
+ echo "obj-m := conftest.o" >build/Makefile
+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_OWNER_TASK_STRUCT 1
+_ACEOF
+
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+ rm -Rf build
+
+
+ EXTRA_KCFLAGS="$tmp_flags"
+
+
{ $as_echo "$as_me:$LINENO: checking whether mutex_lock_nested() is available" >&5
$as_echo_n "checking whether mutex_lock_nested() is available... " >&6; }
@@ -17818,6 +17887,75 @@ fi
+ { $as_echo "$as_me:$LINENO: checking whether struct mutex owner is a task_struct" >&5
+$as_echo_n "checking whether struct mutex owner is a task_struct... " >&6; }
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+ #include <linux/mutex.h>
+
+int
+main (void)
+{
+
+ struct mutex mtx __attribute__ ((unused));
+ mtx.owner = current;
+
+ ;
+ return 0;
+}
+
+_ACEOF
+
+
+ rm -Rf build && mkdir -p build
+ echo "obj-m := conftest.o" >build/Makefile
+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MUTEX_OWNER_TASK_STRUCT 1
+_ACEOF
+
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+ rm -Rf build
+
+
+ EXTRA_KCFLAGS="$tmp_flags"
+
+
{ $as_echo "$as_me:$LINENO: checking whether mutex_lock_nested() is available" >&5
$as_echo_n "checking whether mutex_lock_nested() is available... " >&6; }