Commit 00d1a39e69d5afa7523dad515a05b21abd17c389

Authored by Thomas Gleixner
1 parent 9385d949d5

preempt: Make PREEMPT_ACTIVE generic

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

Showing 32 changed files with 8 additions and 89 deletions Side-by-side Diff

arch/alpha/include/asm/thread_info.h
... ... @@ -58,8 +58,6 @@
58 58 #define THREAD_SIZE_ORDER 1
59 59 #define THREAD_SIZE (2*PAGE_SIZE)
60 60  
61   -#define PREEMPT_ACTIVE 0x40000000
62   -
63 61 /*
64 62 * Thread information flags:
65 63 * - these are process state flags and used from assembly
arch/arc/include/asm/thread_info.h
... ... @@ -80,8 +80,6 @@
80 80  
81 81 #endif /* !__ASSEMBLY__ */
82 82  
83   -#define PREEMPT_ACTIVE 0x10000000
84   -
85 83 /*
86 84 * thread information flags
87 85 * - these are process state flags that various assembly files may need to
arch/arm/include/asm/thread_info.h
... ... @@ -141,12 +141,6 @@
141 141 #endif
142 142  
143 143 /*
144   - * We use bit 30 of the preempt_count to indicate that kernel
145   - * preemption is occurring. See <asm/hardirq.h>.
146   - */
147   -#define PREEMPT_ACTIVE 0x40000000
148   -
149   -/*
150 144 * thread information flags:
151 145 * TIF_SYSCALL_TRACE - syscall trace active
152 146 * TIF_SYSCAL_AUDIT - syscall auditing active
arch/arm64/include/asm/thread_info.h
... ... @@ -89,12 +89,6 @@
89 89 #endif
90 90  
91 91 /*
92   - * We use bit 30 of the preempt_count to indicate that kernel
93   - * preemption is occurring. See <asm/hardirq.h>.
94   - */
95   -#define PREEMPT_ACTIVE 0x40000000
96   -
97   -/*
98 92 * thread information flags:
99 93 * TIF_SYSCALL_TRACE - syscall trace active
100 94 * TIF_SIGPENDING - signal pending
arch/avr32/include/asm/thread_info.h
... ... @@ -66,8 +66,6 @@
66 66  
67 67 #endif /* !__ASSEMBLY__ */
68 68  
69   -#define PREEMPT_ACTIVE 0x40000000
70   -
71 69 /*
72 70 * Thread information flags
73 71 * - these are process state flags that various assembly files may need to access
arch/blackfin/include/asm/thread_info.h
... ... @@ -88,8 +88,6 @@
88 88 #define TI_CPU 12
89 89 #define TI_PREEMPT 16
90 90  
91   -#define PREEMPT_ACTIVE 0x4000000
92   -
93 91 /*
94 92 * thread information flag bit numbers
95 93 */
arch/c6x/include/asm/thread_info.h
... ... @@ -84,8 +84,6 @@
84 84 #define put_thread_info(ti) put_task_struct((ti)->task)
85 85 #endif /* __ASSEMBLY__ */
86 86  
87   -#define PREEMPT_ACTIVE 0x10000000
88   -
89 87 /*
90 88 * thread information flag bit numbers
91 89 * - pending work-to-be-done flags are in LSW
arch/cris/include/asm/thread_info.h
... ... @@ -44,8 +44,6 @@
44 44  
45 45 #endif
46 46  
47   -#define PREEMPT_ACTIVE 0x10000000
48   -
49 47 /*
50 48 * macros/functions for gaining access to the thread information structure
51 49 */
arch/frv/include/asm/thread_info.h
... ... @@ -52,8 +52,6 @@
52 52  
53 53 #endif
54 54  
55   -#define PREEMPT_ACTIVE 0x10000000
56   -
57 55 /*
58 56 * macros/functions for gaining access to the thread information structure
59 57 */
arch/hexagon/include/asm/thread_info.h
... ... @@ -73,10 +73,6 @@
73 73  
74 74 #endif /* __ASSEMBLY__ */
75 75  
76   -/* looks like "linux/hardirq.h" uses this. */
77   -
78   -#define PREEMPT_ACTIVE 0x10000000
79   -
80 76 #ifndef __ASSEMBLY__
81 77  
82 78 #define INIT_THREAD_INFO(tsk) \
arch/ia64/include/asm/thread_info.h
... ... @@ -11,9 +11,6 @@
11 11 #include <asm/processor.h>
12 12 #include <asm/ptrace.h>
13 13  
14   -#define PREEMPT_ACTIVE_BIT 30
15   -#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
16   -
17 14 #ifndef __ASSEMBLY__
18 15  
19 16 /*
arch/m32r/include/asm/thread_info.h
... ... @@ -53,8 +53,6 @@
53 53  
54 54 #endif
55 55  
56   -#define PREEMPT_ACTIVE 0x10000000
57   -
58 56 #define THREAD_SIZE (PAGE_SIZE << 1)
59 57 #define THREAD_SIZE_ORDER 1
60 58 /*
arch/m68k/include/asm/thread_info.h
... ... @@ -35,8 +35,6 @@
35 35 };
36 36 #endif /* __ASSEMBLY__ */
37 37  
38   -#define PREEMPT_ACTIVE 0x4000000
39   -
40 38 #define INIT_THREAD_INFO(tsk) \
41 39 { \
42 40 .task = &tsk, \
arch/metag/include/asm/thread_info.h
... ... @@ -46,8 +46,6 @@
46 46  
47 47 #endif
48 48  
49   -#define PREEMPT_ACTIVE 0x10000000
50   -
51 49 #ifdef CONFIG_4KSTACKS
52 50 #define THREAD_SHIFT 12
53 51 #else
arch/microblaze/include/asm/thread_info.h
... ... @@ -106,8 +106,6 @@
106 106 /* thread information allocation */
107 107 #endif /* __ASSEMBLY__ */
108 108  
109   -#define PREEMPT_ACTIVE 0x10000000
110   -
111 109 /*
112 110 * thread information flags
113 111 * - these are process state flags that various assembly files may
arch/mips/include/asm/thread_info.h
... ... @@ -92,8 +92,6 @@
92 92  
93 93 #define STACK_WARN (THREAD_SIZE / 8)
94 94  
95   -#define PREEMPT_ACTIVE 0x10000000
96   -
97 95 /*
98 96 * thread information flags
99 97 * - these are process state flags that various assembly files may need to
arch/mn10300/include/asm/thread_info.h
... ... @@ -16,8 +16,6 @@
16 16  
17 17 #include <asm/page.h>
18 18  
19   -#define PREEMPT_ACTIVE 0x10000000
20   -
21 19 #ifdef CONFIG_4KSTACKS
22 20 #define THREAD_SIZE (4096)
23 21 #define THREAD_SIZE_ORDER (0)
arch/parisc/include/asm/thread_info.h
... ... @@ -46,9 +46,6 @@
46 46 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
47 47 #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
48 48  
49   -#define PREEMPT_ACTIVE_BIT 28
50   -#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
51   -
52 49 /*
53 50 * thread information flags
54 51 */
arch/powerpc/include/asm/thread_info.h
... ... @@ -82,8 +82,6 @@
82 82  
83 83 #endif /* __ASSEMBLY__ */
84 84  
85   -#define PREEMPT_ACTIVE 0x10000000
86   -
87 85 /*
88 86 * thread information flag bit numbers
89 87 */
arch/s390/include/asm/thread_info.h
... ... @@ -111,7 +111,5 @@
111 111 #define is_32bit_task() (1)
112 112 #endif
113 113  
114   -#define PREEMPT_ACTIVE 0x4000000
115   -
116 114 #endif /* _ASM_THREAD_INFO_H */
arch/score/include/asm/thread_info.h
... ... @@ -72,8 +72,6 @@
72 72  
73 73 #endif /* !__ASSEMBLY__ */
74 74  
75   -#define PREEMPT_ACTIVE 0x10000000
76   -
77 75 /*
78 76 * thread information flags
79 77 * - these are process state flags that various assembly files may need to
arch/sh/include/asm/thread_info.h
... ... @@ -41,8 +41,6 @@
41 41  
42 42 #endif
43 43  
44   -#define PREEMPT_ACTIVE 0x10000000
45   -
46 44 #if defined(CONFIG_4KSTACKS)
47 45 #define THREAD_SHIFT 12
48 46 #else
arch/sh/kernel/entry-common.S
... ... @@ -108,7 +108,7 @@
108 108 and #(0xf0>>1), r0 ! interrupts off (exception path)?
109 109 cmp/eq #(0xf0>>1), r0
110 110 bt noresched
111   - mov.l 3f, r0
  111 + mov.l 1f, r0
112 112 jsr @r0 ! call preempt_schedule_irq
113 113 nop
114 114 bra need_resched
... ... @@ -119,9 +119,7 @@
119 119 nop
120 120  
121 121 .align 2
122   -1: .long PREEMPT_ACTIVE
123   -2: .long schedule
124   -3: .long preempt_schedule_irq
  122 +1: .long preempt_schedule_irq
125 123 #endif
126 124  
127 125 ENTRY(resume_userspace)
arch/sparc/include/asm/thread_info_32.h
... ... @@ -105,8 +105,6 @@
105 105 #define TI_W_SAVED 0x250
106 106 /* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */
107 107  
108   -#define PREEMPT_ACTIVE 0x4000000
109   -
110 108 /*
111 109 * thread information flag bit numbers
112 110 */
arch/sparc/include/asm/thread_info_64.h
... ... @@ -111,8 +111,6 @@
111 111 #define THREAD_SHIFT PAGE_SHIFT
112 112 #endif /* PAGE_SHIFT == 13 */
113 113  
114   -#define PREEMPT_ACTIVE 0x10000000
115   -
116 114 /*
117 115 * macros/functions for gaining access to the thread information structure
118 116 */
arch/tile/include/asm/thread_info.h
... ... @@ -113,8 +113,6 @@
113 113  
114 114 #endif /* !__ASSEMBLY__ */
115 115  
116   -#define PREEMPT_ACTIVE 0x10000000
117   -
118 116 /*
119 117 * Thread information flags that various assembly files may need to access.
120 118 * Keep flags accessed frequently in low bits, particular since it makes
arch/um/include/asm/thread_info.h
... ... @@ -60,8 +60,6 @@
60 60  
61 61 #endif
62 62  
63   -#define PREEMPT_ACTIVE 0x10000000
64   -
65 63 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
66 64 #define TIF_SIGPENDING 1 /* signal pending */
67 65 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
arch/unicore32/include/asm/thread_info.h
... ... @@ -118,12 +118,6 @@
118 118 #endif
119 119  
120 120 /*
121   - * We use bit 30 of the preempt_count to indicate that kernel
122   - * preemption is occurring. See <asm/hardirq.h>.
123   - */
124   -#define PREEMPT_ACTIVE 0x40000000
125   -
126   -/*
127 121 * thread information flags:
128 122 * TIF_SYSCALL_TRACE - syscall trace active
129 123 * TIF_SIGPENDING - signal pending
arch/x86/include/asm/thread_info.h
... ... @@ -153,8 +153,6 @@
153 153 #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
154 154 #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
155 155  
156   -#define PREEMPT_ACTIVE 0x10000000
157   -
158 156 #ifdef CONFIG_X86_32
159 157  
160 158 #define STACK_WARN (THREAD_SIZE/8)
arch/xtensa/include/asm/thread_info.h
... ... @@ -76,8 +76,6 @@
76 76  
77 77 #endif
78 78  
79   -#define PREEMPT_ACTIVE 0x10000000
80   -
81 79 /*
82 80 * macros/functions for gaining access to the thread information structure
83 81 */
include/linux/preempt_mask.h
... ... @@ -17,10 +17,11 @@
17 17 * there are a few palaeontologic drivers which reenable interrupts in
18 18 * the handler, so we need more than one bit here.
19 19 *
20   - * PREEMPT_MASK: 0x000000ff
21   - * SOFTIRQ_MASK: 0x0000ff00
22   - * HARDIRQ_MASK: 0x000f0000
23   - * NMI_MASK: 0x00100000
  20 + * PREEMPT_MASK: 0x000000ff
  21 + * SOFTIRQ_MASK: 0x0000ff00
  22 + * HARDIRQ_MASK: 0x000f0000
  23 + * NMI_MASK: 0x00100000
  24 + * PREEMPT_ACTIVE: 0x00200000
24 25 */
25 26 #define PREEMPT_BITS 8
26 27 #define SOFTIRQ_BITS 8
27 28  
... ... @@ -46,15 +47,9 @@
46 47  
47 48 #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
48 49  
49   -#ifndef PREEMPT_ACTIVE
50 50 #define PREEMPT_ACTIVE_BITS 1
51 51 #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
52 52 #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
53   -#endif
54   -
55   -#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
56   -#error PREEMPT_ACTIVE is too low!
57   -#endif
58 53  
59 54 #define hardirq_count() (preempt_count() & HARDIRQ_MASK)
60 55 #define softirq_count() (preempt_count() & SOFTIRQ_MASK)
include/linux/sched.h
... ... @@ -22,7 +22,7 @@
22 22 #include <linux/errno.h>
23 23 #include <linux/nodemask.h>
24 24 #include <linux/mm_types.h>
25   -#include <linux/preempt.h>
  25 +#include <linux/preempt_mask.h>
26 26  
27 27 #include <asm/page.h>
28 28 #include <asm/ptrace.h>