]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix PREEMPT_ACTIVE definition
authorPaul Mackerras <paulus@samba.org>
Fri, 22 Oct 2004 00:35:33 +0000 (17:35 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 22 Oct 2004 00:35:33 +0000 (17:35 -0700)
When the generic IRQ stuff went in, it seems that HARDIRQ_BITS got bumped
from 9 (for ppc64) up to 12.  Consequently, the PREEMPT_ACTIVE bit is now
within HARDIRQ_MASK, and I get in_interrupt() falsely returning true when
PREEMPT_ACTIVE is set, and thus a BUG_ON tripping in arch/ppc64/mm/tlb.c.

The patch below fixes this by changing PREEMPT_ACTIVE to 0x10000000.  I
have changed the PREEMPT_ACTIVE definitions for each of the architectures
that define CONFIG_GENERIC_HARDIRQS (i386, ppc, ppc64, x86_64) and fixed
the comment in include/linux/hardirq.h.  We could perhaps move the
PREEMPT_ACTIVE definition to include/linux/hardirq.h - I don't know why it
is still per-arch.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-i386/thread_info.h
include/asm-ppc/thread_info.h
include/asm-ppc64/thread_info.h
include/asm-x86_64/thread_info.h
include/linux/hardirq.h

index 93460648d90414493ceffa306d1e25c7f38afe64..9eba8cbd0d4aac55aac203478300fc9caf4d9b57 100644 (file)
@@ -51,7 +51,7 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x4000000
+#define PREEMPT_ACTIVE         0x10000000
 #ifdef CONFIG_4KSTACKS
 #define THREAD_SIZE            (4096)
 #else
index 340235dfc1c9750a07de8239dada16a58da11857..c39b6ce04599a9fe3fd13122ba527c45d077a590 100644 (file)
@@ -65,7 +65,7 @@ static inline struct thread_info *current_thread_info(void)
  */
 #define THREAD_SIZE            8192    /* 2 pages */
 
-#define PREEMPT_ACTIVE         0x4000000
+#define PREEMPT_ACTIVE         0x10000000
 
 /*
  * thread information flag bit numbers
index 04aec3ba8d4d482fddad5b971babc9f65bba4c07..6a8a4c4c334ddf7a4854e1ebb15eee30e9721b2b 100644 (file)
@@ -82,7 +82,7 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif /* __ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x4000000
+#define PREEMPT_ACTIVE         0x10000000
 
 /*
  * thread information flag bit numbers
index 73e4fa13ed0c123d0a5260b8afb5e663f8832bc4..4e2743453551222a0d85fc4cdf05ff39c286ba61 100644 (file)
@@ -125,7 +125,7 @@ static inline struct thread_info *stack_thread_info(void)
 /* work to do on any return to user space */
 #define _TIF_ALLWORK_MASK 0x0000FFFF   
 
-#define PREEMPT_ACTIVE     0x4000000
+#define PREEMPT_ACTIVE     0x10000000
 
 /*
  * Thread-synchronous status.
index 97343be12ad8e89048ef8b7ac19ce8702ec48661..7969257bc87a675b61d422bcf1949a4cec819fe5 100644 (file)
@@ -14,7 +14,7 @@
  * - bits 8-15 are the softirq count (max # of softirqs: 256)
  * - bits 16-27 are the hardirq count (max # of hardirqs: 4096)
  *
- * - ( bit 26 is the PREEMPT_ACTIVE flag. )
+ * - ( bit 28 is the PREEMPT_ACTIVE flag. )
  *
  * PREEMPT_MASK: 0x000000ff
  * SOFTIRQ_MASK: 0x0000ff00