aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/preempt.h12
-rw-r--r--include/linux/preempt.h2
-rw-r--r--include/linux/thread_info.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
index c8b051933b1..b39e194f6c8 100644
--- a/arch/x86/include/asm/preempt.h
+++ b/arch/x86/include/asm/preempt.h
@@ -5,6 +5,18 @@
#include <asm/percpu.h>
#include <linux/thread_info.h>
+#ifdef CONFIG_X86_32
+/*
+ * i386's current_thread_info() depends on ESP and for interrupt/exception
+ * stacks this doesn't yield the actual task thread_info.
+ *
+ * We hard rely on the fact that all the TIF_NEED_RESCHED bits are
+ * the same, therefore use the slightly more expensive version below.
+ */
+#undef tif_need_resched
+#define tif_need_resched() test_tsk_thread_flag(current, TIF_NEED_RESCHED)
+#endif
+
DECLARE_PER_CPU(int, __preempt_count);
/*
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index de83b4eb164..1841b58cf17 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -15,6 +15,8 @@
*/
#define PREEMPT_NEED_RESCHED 0x80000000
+#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
+
#include <asm/preempt.h>
#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER)
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index fddbe2023a5..a629e4b2321 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -118,8 +118,6 @@ static inline __deprecated void set_need_resched(void)
*/
}
-#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
-
#if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK
/*
* An arch can define its own version of set_restore_sigmask() to get the