preempt: Make PREEMPT_ACTIVE generic
authorThomas Gleixner <tglx@linutronix.de>
Tue, 17 Sep 2013 18:53:09 +0000 (18:53 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 13 Nov 2013 19:21:47 +0000 (20:21 +0100)
No point in having this bit defined by architecture.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130917183629.090698799@linutronix.de
32 files changed:
arch/alpha/include/asm/thread_info.h
arch/arc/include/asm/thread_info.h
arch/arm/include/asm/thread_info.h
arch/arm64/include/asm/thread_info.h
arch/avr32/include/asm/thread_info.h
arch/blackfin/include/asm/thread_info.h
arch/c6x/include/asm/thread_info.h
arch/cris/include/asm/thread_info.h
arch/frv/include/asm/thread_info.h
arch/hexagon/include/asm/thread_info.h
arch/ia64/include/asm/thread_info.h
arch/m32r/include/asm/thread_info.h
arch/m68k/include/asm/thread_info.h
arch/metag/include/asm/thread_info.h
arch/microblaze/include/asm/thread_info.h
arch/mips/include/asm/thread_info.h
arch/mn10300/include/asm/thread_info.h
arch/parisc/include/asm/thread_info.h
arch/powerpc/include/asm/thread_info.h
arch/s390/include/asm/thread_info.h
arch/score/include/asm/thread_info.h
arch/sh/include/asm/thread_info.h
arch/sh/kernel/entry-common.S
arch/sparc/include/asm/thread_info_32.h
arch/sparc/include/asm/thread_info_64.h
arch/tile/include/asm/thread_info.h
arch/um/include/asm/thread_info.h
arch/unicore32/include/asm/thread_info.h
arch/x86/include/asm/thread_info.h
arch/xtensa/include/asm/thread_info.h
include/linux/preempt_mask.h
include/linux/sched.h

index 52cd2a4a3ff486c8e7acefb35c6e6d24a911f025..453597b91f3a6560320524e4ef7a4338a5ae8e10 100644 (file)
@@ -58,8 +58,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
 #define THREAD_SIZE_ORDER 1
 #define THREAD_SIZE (2*PAGE_SIZE)
 
-#define PREEMPT_ACTIVE         0x40000000
-
 /*
  * Thread information flags:
  * - these are process state flags and used from assembly
index 2d50a4cdd7f3dacb8828aaa5c40133a2fc6c7681..45be2167201183172695d0a788c0b20b87ec7ce2 100644 (file)
@@ -80,8 +80,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE      0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may need to
index df5e13d64f2c02b28963c23b319a7634cf5dacc8..71a06b293489ddffd1b4177eca38572501c0ce36 100644 (file)
@@ -140,12 +140,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
                                    struct user_vfp_exc __user *);
 #endif
 
-/*
- * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occurring.  See <asm/hardirq.h>.
- */
-#define PREEMPT_ACTIVE 0x40000000
-
 /*
  * thread information flags:
  *  TIF_SYSCALL_TRACE  - syscall trace active
index 23a3c4791d86cb71f9a2520e2176212b1e107503..720e70b66ffdcf6eff60efc964c32e9a0584325b 100644 (file)
@@ -88,12 +88,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif
 
-/*
- * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occurring.  See <asm/hardirq.h>.
- */
-#define PREEMPT_ACTIVE 0x40000000
-
 /*
  * thread information flags:
  *  TIF_SYSCALL_TRACE  - syscall trace active
index 6dc62e1f94c7801532c9a3bc0be13abe3f8009e4..a978f3fe7c25a2fc651b19179b846f3939047bd9 100644 (file)
@@ -66,8 +66,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x40000000
-
 /*
  * Thread information flags
  * - these are process state flags that various assembly files may need to access
index 3894005337ba7d8628de4f7de2f9f7dd8f5b603d..55f473bdad361a42ca625433a8d8bfb629f378bf 100644 (file)
@@ -88,8 +88,6 @@ static inline struct thread_info *current_thread_info(void)
 #define TI_CPU         12
 #define TI_PREEMPT     16
 
-#define        PREEMPT_ACTIVE  0x4000000
-
 /*
  * thread information flag bit numbers
  */
index 4c8dc562bd90dce27d0236140434a34120fe33d7..d4e9ef87076dbe4e0013876c27fdd84d69840d75 100644 (file)
@@ -84,8 +84,6 @@ struct thread_info *current_thread_info(void)
 #define put_thread_info(ti)    put_task_struct((ti)->task)
 #endif /* __ASSEMBLY__ */
 
-#define        PREEMPT_ACTIVE  0x10000000
-
 /*
  * thread information flag bit numbers
  * - pending work-to-be-done flags are in LSW
index 07c8c40c52b312ddfee756ca8ea5b0619ddb4a65..55dede18c032e37195cdb5c17ccebfddebc505a8 100644 (file)
@@ -44,8 +44,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index bebd7eadc7720c3e3ddac4fe455a8bef37308042..af29e17c01814a2d88be2ca5d535f31441ddc474 100644 (file)
@@ -52,8 +52,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index f7c32406a711a5b619d53037fe76d8689107e3c6..a59dad3b3695112e6f15633de0f3b9304af17532 100644 (file)
@@ -73,10 +73,6 @@ struct thread_info {
 
 #endif  /* __ASSEMBLY__  */
 
-/*  looks like "linux/hardirq.h" uses this.  */
-
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifndef __ASSEMBLY__
 
 #define INIT_THREAD_INFO(tsk)                   \
index cade13dd0299f8754d18d87eded8661b64bf3eb8..5957cf61f8980641c54271ab4030b1d765570001 100644 (file)
@@ -11,9 +11,6 @@
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 
-#define PREEMPT_ACTIVE_BIT 30
-#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
-
 #ifndef __ASSEMBLY__
 
 /*
index c074f4c2e858e6cc76b16476a9fc24aea2566793..00171703402f19b576612f699bf733fe12252390 100644 (file)
@@ -53,8 +53,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #define THREAD_SIZE            (PAGE_SIZE << 1)
 #define THREAD_SIZE_ORDER      1
 /*
index 126131f94a2ca951a2db9c9a414e3c30a142baeb..21a4784ca5a186256cfbb5bc6d1d1b7cd4de3e1c 100644 (file)
@@ -35,8 +35,6 @@ struct thread_info {
 };
 #endif /* __ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x4000000
-
 #define INIT_THREAD_INFO(tsk)                  \
 {                                              \
        .task           = &tsk,                 \
index 7c4a3300614230ce8d956257412e8e0ab0ade8fb..b19e9c588a16733e81f5495593c881d2d9c7c170 100644 (file)
@@ -46,8 +46,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifdef CONFIG_4KSTACKS
 #define THREAD_SHIFT           12
 #else
index de26ea6373ded64af3d7793489be9343a1ee1075..8c9d36591a031d6a84e81ae7485185aea125a5e3 100644 (file)
@@ -106,8 +106,6 @@ static inline struct thread_info *current_thread_info(void)
 /* thread information allocation */
 #endif /* __ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may
index f9b24bfbdbae96f8cc31d58d7cb0318130ceab9f..4f58ef6d0eed5c58c9e58595fac36b4b7f747a2e 100644 (file)
@@ -92,8 +92,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #define STACK_WARN     (THREAD_SIZE / 8)
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may need to
index 224b4262486dbca41453861f95461b635bb40bcc..bf280eaccd36fd7e7b963176184450fb98126340 100644 (file)
@@ -16,8 +16,6 @@
 
 #include <asm/page.h>
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifdef CONFIG_4KSTACKS
 #define THREAD_SIZE            (4096)
 #define THREAD_SIZE_ORDER      (0)
index bc7cf120106b30e477264850e373f346eeb9bf82..d5f97ea3a4e1ab13a018de4d5d549f90efe4f299 100644 (file)
@@ -46,9 +46,6 @@ struct thread_info {
 #define THREAD_SIZE             (PAGE_SIZE << THREAD_SIZE_ORDER)
 #define THREAD_SHIFT            (PAGE_SHIFT + THREAD_SIZE_ORDER)
 
-#define PREEMPT_ACTIVE_BIT     28
-#define PREEMPT_ACTIVE         (1 << PREEMPT_ACTIVE_BIT)
-
 /*
  * thread information flags
  */
index ba7b1973866e1933486f47ed59e3aa0efe799f34..8fd6cf6dcee854c8244010ce12d107abb0fa81d7 100644 (file)
@@ -82,8 +82,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif /* __ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flag bit numbers
  */
index eb5f64d26d06190de4695d38e9190449859588df..10e0fcd3633d178f25b299a709b9c80706f05818 100644 (file)
@@ -111,6 +111,4 @@ static inline struct thread_info *current_thread_info(void)
 #define is_32bit_task()                (1)
 #endif
 
-#define PREEMPT_ACTIVE         0x4000000
-
 #endif /* _ASM_THREAD_INFO_H */
index 1425cc034872e5993320e6722f4965bdb34f1189..656b7ada9326ab63ba45b42f3404cc39979e16f5 100644 (file)
@@ -72,8 +72,6 @@ register struct thread_info *__current_thread_info __asm__("r28");
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may need to
index 45a93669289da4d7ff53119d9d3ea69158fced7e..ad27ffa65e2eafd2fb89c959c812862b70ba8665 100644 (file)
@@ -41,8 +41,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #if defined(CONFIG_4KSTACKS)
 #define THREAD_SHIFT   12
 #else
index 9b6e4beeb296261c2fb5b315377822e236c587cf..ca46834294b7fa9fbf7f99eb0958ae1c18af6df7 100644 (file)
@@ -108,7 +108,7 @@ need_resched:
        and     #(0xf0>>1), r0          ! interrupts off (exception path)?
        cmp/eq  #(0xf0>>1), r0
        bt      noresched
-       mov.l   3f, r0
+       mov.l   1f, r0
        jsr     @r0                     ! call preempt_schedule_irq
         nop
        bra     need_resched
@@ -119,9 +119,7 @@ noresched:
         nop
 
        .align 2
-1:     .long   PREEMPT_ACTIVE
-2:     .long   schedule
-3:     .long   preempt_schedule_irq
+1:     .long   preempt_schedule_irq
 #endif
 
 ENTRY(resume_userspace)
index dd3807599bb9ac63573191e1086e506699e5d41a..96efa7adc22330d2684e67ab3c83dafa99e89e8a 100644 (file)
@@ -105,8 +105,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
 #define TI_W_SAVED     0x250
 /* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */
 
-#define PREEMPT_ACTIVE         0x4000000
-
 /*
  * thread information flag bit numbers
  */
index d5e5042510790a1927e5f8b9a234038a599bcab7..2b4e17b79e9cec87a633b7afec724297ae4e17cf 100644 (file)
@@ -111,8 +111,6 @@ struct thread_info {
 #define THREAD_SHIFT PAGE_SHIFT
 #endif /* PAGE_SHIFT == 13 */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index b8aa6df3e102d0cf7a2dd7ba7e4f8e9309e983d6..729aa107f64e6391cb435ff1f5c038065eafe3b2 100644 (file)
@@ -113,8 +113,6 @@ extern void _cpu_idle(void);
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * Thread information flags that various assembly files may need to access.
  * Keep flags accessed frequently in low bits, particular since it makes
index 2c8eeb2df8b43a6c21b4b10da99fe1042276229f..1c5b2a83046aab011e03c1e735b020a374608838 100644 (file)
@@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #define TIF_SYSCALL_TRACE      0       /* syscall trace active */
 #define TIF_SIGPENDING         1       /* signal pending */
 #define TIF_NEED_RESCHED       2       /* rescheduling necessary */
index 818b4a1edb5b1bd26e3d8eb7baffe212df50a6f0..af36d8eabdf1c1dd6650e10682eff053550c906a 100644 (file)
@@ -117,12 +117,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif
 
-/*
- * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occurring.  See <asm/hardirq.h>.
- */
-#define PREEMPT_ACTIVE 0x40000000
-
 /*
  * thread information flags:
  *  TIF_SYSCALL_TRACE  - syscall trace active
index c46a46be1ec699c0a92180c4f584da150fd7f5eb..3ba3de457d053e77eb36d7d6fe78f7769a1df470 100644 (file)
@@ -153,8 +153,6 @@ struct thread_info {
 #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
 #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifdef CONFIG_X86_32
 
 #define STACK_WARN     (THREAD_SIZE/8)
index 9481004ac119e04ef8f6a80921561de071b445a1..470153e8547c19a6819ac4cfbea3aa095b3dd33e 100644 (file)
@@ -76,8 +76,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index 810d7e386f20205d25fae601b3e0436dd3288dfd..d169820203dd825e54bd35479954e162509e78d8 100644 (file)
  * there are a few palaeontologic drivers which reenable interrupts in
  * the handler, so we need more than one bit here.
  *
- * PREEMPT_MASK: 0x000000ff
- * SOFTIRQ_MASK: 0x0000ff00
- * HARDIRQ_MASK: 0x000f0000
- *     NMI_MASK: 0x00100000
+ * PREEMPT_MASK:       0x000000ff
+ * SOFTIRQ_MASK:       0x0000ff00
+ * HARDIRQ_MASK:       0x000f0000
+ *     NMI_MASK:       0x00100000
+ * PREEMPT_ACTIVE:     0x00200000
  */
 #define PREEMPT_BITS   8
 #define SOFTIRQ_BITS   8
 
 #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
 
-#ifndef PREEMPT_ACTIVE
 #define PREEMPT_ACTIVE_BITS    1
 #define PREEMPT_ACTIVE_SHIFT   (NMI_SHIFT + NMI_BITS)
 #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
-#endif
-
-#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
-#error PREEMPT_ACTIVE is too low!
-#endif
 
 #define hardirq_count()        (preempt_count() & HARDIRQ_MASK)
 #define softirq_count()        (preempt_count() & SOFTIRQ_MASK)
index 045b0d2278463583e90a57d7e80d4257ecea1b06..55080df48b7043716aae6be13db693dad54be408 100644 (file)
@@ -22,7 +22,7 @@ struct sched_param {
 #include <linux/errno.h>
 #include <linux/nodemask.h>
 #include <linux/mm_types.h>
-#include <linux/preempt.h>
+#include <linux/preempt_mask.h>
 
 #include <asm/page.h>
 #include <asm/ptrace.h>