aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/include/asm/thread_info.h2
-rw-r--r--arch/arc/include/asm/thread_info.h2
-rw-r--r--arch/arm/include/asm/thread_info.h6
-rw-r--r--arch/arm64/include/asm/thread_info.h6
-rw-r--r--arch/avr32/include/asm/thread_info.h2
-rw-r--r--arch/blackfin/include/asm/hardirq.h3
-rw-r--r--arch/blackfin/include/asm/thread_info.h2
-rw-r--r--arch/c6x/include/asm/thread_info.h2
-rw-r--r--arch/cris/include/asm/hardirq.h12
-rw-r--r--arch/cris/include/asm/thread_info.h2
-rw-r--r--arch/frv/include/asm/thread_info.h2
-rw-r--r--arch/hexagon/include/asm/thread_info.h4
-rw-r--r--arch/ia64/include/asm/thread_info.h3
-rw-r--r--arch/ia64/kernel/entry.S15
-rw-r--r--arch/m32r/include/asm/hardirq.h16
-rw-r--r--arch/m32r/include/asm/thread_info.h2
-rw-r--r--arch/m32r/kernel/entry.S8
-rw-r--r--arch/m68k/include/asm/hardirq.h11
-rw-r--r--arch/m68k/include/asm/thread_info.h2
-rw-r--r--arch/m68k/kernel/entry.S40
-rw-r--r--arch/m68k/kernel/ints.c6
-rw-r--r--arch/m68k/platform/68000/entry.S33
-rw-r--r--arch/m68k/platform/68360/entry.S24
-rw-r--r--arch/metag/include/asm/thread_info.h2
-rw-r--r--arch/microblaze/include/asm/thread_info.h2
-rw-r--r--arch/mips/include/asm/thread_info.h2
-rw-r--r--arch/mn10300/include/asm/thread_info.h2
-rw-r--r--arch/parisc/include/asm/thread_info.h3
-rw-r--r--arch/powerpc/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/hardirq.h2
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/score/include/asm/thread_info.h2
-rw-r--r--arch/sh/include/asm/thread_info.h2
-rw-r--r--arch/sh/kernel/entry-common.S6
-rw-r--r--arch/sparc/include/asm/hardirq_32.h1
-rw-r--r--arch/sparc/include/asm/hardirq_64.h2
-rw-r--r--arch/sparc/include/asm/thread_info_32.h2
-rw-r--r--arch/sparc/include/asm/thread_info_64.h2
-rw-r--r--arch/sparc/kernel/rtrap_64.S6
-rw-r--r--arch/tile/include/asm/hardirq.h2
-rw-r--r--arch/tile/include/asm/thread_info.h2
-rw-r--r--arch/um/include/asm/thread_info.h2
-rw-r--r--arch/unicore32/include/asm/thread_info.h6
-rw-r--r--arch/x86/include/asm/thread_info.h2
-rw-r--r--arch/xtensa/include/asm/thread_info.h2
-rw-r--r--include/linux/irq.h7
-rw-r--r--include/linux/preempt_mask.h41
-rw-r--r--include/linux/sched.h2
-rw-r--r--kernel/irq/settings.h7
-rw-r--r--kernel/irq/spurious.c12
50 files changed, 55 insertions, 275 deletions
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index 52cd2a4a3ff4..453597b91f3a 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -58,8 +58,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
58#define THREAD_SIZE_ORDER 1 58#define THREAD_SIZE_ORDER 1
59#define THREAD_SIZE (2*PAGE_SIZE) 59#define THREAD_SIZE (2*PAGE_SIZE)
60 60
61#define PREEMPT_ACTIVE 0x40000000
62
63/* 61/*
64 * Thread information flags: 62 * Thread information flags:
65 * - these are process state flags and used from assembly 63 * - these are process state flags and used from assembly
diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h
index 2d50a4cdd7f3..45be21672011 100644
--- a/arch/arc/include/asm/thread_info.h
+++ b/arch/arc/include/asm/thread_info.h
@@ -80,8 +80,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
80 80
81#endif /* !__ASSEMBLY__ */ 81#endif /* !__ASSEMBLY__ */
82 82
83#define PREEMPT_ACTIVE 0x10000000
84
85/* 83/*
86 * thread information flags 84 * thread information flags
87 * - these are process state flags that various assembly files may need to 85 * - these are process state flags that various assembly files may need to
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index df5e13d64f2c..71a06b293489 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -141,12 +141,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
141#endif 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 * thread information flags: 144 * thread information flags:
151 * TIF_SYSCALL_TRACE - syscall trace active 145 * TIF_SYSCALL_TRACE - syscall trace active
152 * TIF_SYSCAL_AUDIT - syscall auditing active 146 * TIF_SYSCAL_AUDIT - syscall auditing active
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index 23a3c4791d86..720e70b66ffd 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -89,12 +89,6 @@ static inline struct thread_info *current_thread_info(void)
89#endif 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 * thread information flags: 92 * thread information flags:
99 * TIF_SYSCALL_TRACE - syscall trace active 93 * TIF_SYSCALL_TRACE - syscall trace active
100 * TIF_SIGPENDING - signal pending 94 * TIF_SIGPENDING - signal pending
diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
index 6dc62e1f94c7..a978f3fe7c25 100644
--- a/arch/avr32/include/asm/thread_info.h
+++ b/arch/avr32/include/asm/thread_info.h
@@ -66,8 +66,6 @@ static inline struct thread_info *current_thread_info(void)
66 66
67#endif /* !__ASSEMBLY__ */ 67#endif /* !__ASSEMBLY__ */
68 68
69#define PREEMPT_ACTIVE 0x40000000
70
71/* 69/*
72 * Thread information flags 70 * Thread information flags
73 * - these are process state flags that various assembly files may need to access 71 * - these are process state flags that various assembly files may need to access
diff --git a/arch/blackfin/include/asm/hardirq.h b/arch/blackfin/include/asm/hardirq.h
index c078dd78d998..58b54a6d5a16 100644
--- a/arch/blackfin/include/asm/hardirq.h
+++ b/arch/blackfin/include/asm/hardirq.h
@@ -12,9 +12,6 @@
12extern void ack_bad_irq(unsigned int irq); 12extern void ack_bad_irq(unsigned int irq);
13#define ack_bad_irq ack_bad_irq 13#define ack_bad_irq ack_bad_irq
14 14
15/* Define until common code gets sane defaults */
16#define HARDIRQ_BITS 9
17
18#include <asm-generic/hardirq.h> 15#include <asm-generic/hardirq.h>
19 16
20#endif 17#endif
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 3894005337ba..55f473bdad36 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -88,8 +88,6 @@ static inline struct thread_info *current_thread_info(void)
88#define TI_CPU 12 88#define TI_CPU 12
89#define TI_PREEMPT 16 89#define TI_PREEMPT 16
90 90
91#define PREEMPT_ACTIVE 0x4000000
92
93/* 91/*
94 * thread information flag bit numbers 92 * thread information flag bit numbers
95 */ 93 */
diff --git a/arch/c6x/include/asm/thread_info.h b/arch/c6x/include/asm/thread_info.h
index 4c8dc562bd90..d4e9ef87076d 100644
--- a/arch/c6x/include/asm/thread_info.h
+++ b/arch/c6x/include/asm/thread_info.h
@@ -84,8 +84,6 @@ struct thread_info *current_thread_info(void)
84#define put_thread_info(ti) put_task_struct((ti)->task) 84#define put_thread_info(ti) put_task_struct((ti)->task)
85#endif /* __ASSEMBLY__ */ 85#endif /* __ASSEMBLY__ */
86 86
87#define PREEMPT_ACTIVE 0x10000000
88
89/* 87/*
90 * thread information flag bit numbers 88 * thread information flag bit numbers
91 * - pending work-to-be-done flags are in LSW 89 * - pending work-to-be-done flags are in LSW
diff --git a/arch/cris/include/asm/hardirq.h b/arch/cris/include/asm/hardirq.h
index 17bb12d760b2..04126f7bfab2 100644
--- a/arch/cris/include/asm/hardirq.h
+++ b/arch/cris/include/asm/hardirq.h
@@ -2,18 +2,6 @@
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4#include <asm/irq.h> 4#include <asm/irq.h>
5
6#define HARDIRQ_BITS 8
7
8/*
9 * The hardirq mask has to be large enough to have
10 * space for potentially all IRQ sources in the system
11 * nesting on a single CPU:
12 */
13#if (1 << HARDIRQ_BITS) < NR_IRQS
14# error HARDIRQ_BITS is too low!
15#endif
16
17#include <asm-generic/hardirq.h> 5#include <asm-generic/hardirq.h>
18 6
19#endif /* __ASM_HARDIRQ_H */ 7#endif /* __ASM_HARDIRQ_H */
diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h
index 07c8c40c52b3..55dede18c032 100644
--- a/arch/cris/include/asm/thread_info.h
+++ b/arch/cris/include/asm/thread_info.h
@@ -44,8 +44,6 @@ struct thread_info {
44 44
45#endif 45#endif
46 46
47#define PREEMPT_ACTIVE 0x10000000
48
49/* 47/*
50 * macros/functions for gaining access to the thread information structure 48 * macros/functions for gaining access to the thread information structure
51 */ 49 */
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index bebd7eadc772..af29e17c0181 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -52,8 +52,6 @@ struct thread_info {
52 52
53#endif 53#endif
54 54
55#define PREEMPT_ACTIVE 0x10000000
56
57/* 55/*
58 * macros/functions for gaining access to the thread information structure 56 * macros/functions for gaining access to the thread information structure
59 */ 57 */
diff --git a/arch/hexagon/include/asm/thread_info.h b/arch/hexagon/include/asm/thread_info.h
index f7c32406a711..a59dad3b3695 100644
--- a/arch/hexagon/include/asm/thread_info.h
+++ b/arch/hexagon/include/asm/thread_info.h
@@ -73,10 +73,6 @@ struct thread_info {
73 73
74#endif /* __ASSEMBLY__ */ 74#endif /* __ASSEMBLY__ */
75 75
76/* looks like "linux/hardirq.h" uses this. */
77
78#define PREEMPT_ACTIVE 0x10000000
79
80#ifndef __ASSEMBLY__ 76#ifndef __ASSEMBLY__
81 77
82#define INIT_THREAD_INFO(tsk) \ 78#define INIT_THREAD_INFO(tsk) \
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index cade13dd0299..5957cf61f898 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -11,9 +11,6 @@
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/ptrace.h> 12#include <asm/ptrace.h>
13 13
14#define PREEMPT_ACTIVE_BIT 30
15#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
16
17#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
18 15
19/* 16/*
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 7a53530f22c2..ddea607f948a 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1169,21 +1169,8 @@ skip_rbs_switch:
1169.work_pending: 1169.work_pending:
1170 tbit.z p6,p0=r31,TIF_NEED_RESCHED // is resched not needed? 1170 tbit.z p6,p0=r31,TIF_NEED_RESCHED // is resched not needed?
1171(p6) br.cond.sptk.few .notify 1171(p6) br.cond.sptk.few .notify
1172#ifdef CONFIG_PREEMPT 1172 br.call.spnt.many rp=preempt_schedule_irq
1173(pKStk) dep r21=-1,r0,PREEMPT_ACTIVE_BIT,1
1174 ;;
1175(pKStk) st4 [r20]=r21
1176#endif
1177 SSM_PSR_I(p0, p6, r2) // enable interrupts
1178 br.call.spnt.many rp=schedule
1179.ret9: cmp.eq p6,p0=r0,r0 // p6 <- 1 (re-check) 1173.ret9: cmp.eq p6,p0=r0,r0 // p6 <- 1 (re-check)
1180 RSM_PSR_I(p0, r2, r20) // disable interrupts
1181 ;;
1182#ifdef CONFIG_PREEMPT
1183(pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
1184 ;;
1185(pKStk) st4 [r20]=r0 // preempt_count() <- 0
1186#endif
1187(pLvSys)br.cond.sptk.few __paravirt_pending_syscall_end 1174(pLvSys)br.cond.sptk.few __paravirt_pending_syscall_end
1188 br.cond.sptk.many .work_processed_kernel 1175 br.cond.sptk.many .work_processed_kernel
1189 1176
diff --git a/arch/m32r/include/asm/hardirq.h b/arch/m32r/include/asm/hardirq.h
index 4c31c0ae215e..5f2ac4f64ddf 100644
--- a/arch/m32r/include/asm/hardirq.h
+++ b/arch/m32r/include/asm/hardirq.h
@@ -3,22 +3,6 @@
3#define __ASM_HARDIRQ_H 3#define __ASM_HARDIRQ_H
4 4
5#include <asm/irq.h> 5#include <asm/irq.h>
6
7#if NR_IRQS > 256
8#define HARDIRQ_BITS 9
9#else
10#define HARDIRQ_BITS 8
11#endif
12
13/*
14 * The hardirq mask has to be large enough to have
15 * space for potentially all IRQ sources in the system
16 * nesting on a single CPU:
17 */
18#if (1 << HARDIRQ_BITS) < NR_IRQS
19# error HARDIRQ_BITS is too low!
20#endif
21
22#include <asm-generic/hardirq.h> 6#include <asm-generic/hardirq.h>
23 7
24#endif /* __ASM_HARDIRQ_H */ 8#endif /* __ASM_HARDIRQ_H */
diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
index c074f4c2e858..00171703402f 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -53,8 +53,6 @@ struct thread_info {
53 53
54#endif 54#endif
55 55
56#define PREEMPT_ACTIVE 0x10000000
57
58#define THREAD_SIZE (PAGE_SIZE << 1) 56#define THREAD_SIZE (PAGE_SIZE << 1)
59#define THREAD_SIZE_ORDER 1 57#define THREAD_SIZE_ORDER 1
60/* 58/*
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S
index 0c01543f10cd..7c3db9940ce1 100644
--- a/arch/m32r/kernel/entry.S
+++ b/arch/m32r/kernel/entry.S
@@ -182,13 +182,7 @@ need_resched:
182 ld r4, PSW(sp) ; interrupts off (exception path) ? 182 ld r4, PSW(sp) ; interrupts off (exception path) ?
183 and3 r4, r4, #0x4000 183 and3 r4, r4, #0x4000
184 beqz r4, restore_all 184 beqz r4, restore_all
185 LDIMM (r4, PREEMPT_ACTIVE) 185 bl preempt_schedule_irq
186 st r4, @(TI_PRE_COUNT, r8)
187 ENABLE_INTERRUPTS(r4)
188 bl schedule
189 ldi r4, #0
190 st r4, @(TI_PRE_COUNT, r8)
191 DISABLE_INTERRUPTS(r4)
192 bra need_resched 186 bra need_resched
193#endif 187#endif
194 188
diff --git a/arch/m68k/include/asm/hardirq.h b/arch/m68k/include/asm/hardirq.h
index db30ed276878..6c618529d9b9 100644
--- a/arch/m68k/include/asm/hardirq.h
+++ b/arch/m68k/include/asm/hardirq.h
@@ -5,17 +5,6 @@
5#include <linux/cache.h> 5#include <linux/cache.h>
6#include <asm/irq.h> 6#include <asm/irq.h>
7 7
8#define HARDIRQ_BITS 8
9
10/*
11 * The hardirq mask has to be large enough to have
12 * space for potentially all IRQ sources in the system
13 * nesting on a single CPU:
14 */
15#if (1 << HARDIRQ_BITS) < NR_IRQS
16# error HARDIRQ_BITS is too low!
17#endif
18
19#ifdef CONFIG_MMU 8#ifdef CONFIG_MMU
20 9
21static inline void ack_bad_irq(unsigned int irq) 10static inline void ack_bad_irq(unsigned int irq)
diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h
index 126131f94a2c..21a4784ca5a1 100644
--- a/arch/m68k/include/asm/thread_info.h
+++ b/arch/m68k/include/asm/thread_info.h
@@ -35,8 +35,6 @@ struct thread_info {
35}; 35};
36#endif /* __ASSEMBLY__ */ 36#endif /* __ASSEMBLY__ */
37 37
38#define PREEMPT_ACTIVE 0x4000000
39
40#define INIT_THREAD_INFO(tsk) \ 38#define INIT_THREAD_INFO(tsk) \
41{ \ 39{ \
42 .task = &tsk, \ 40 .task = &tsk, \
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index a78f5649e8de..b54ac7aba850 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -45,7 +45,7 @@
45.globl system_call, buserr, trap, resume 45.globl system_call, buserr, trap, resume
46.globl sys_call_table 46.globl sys_call_table
47.globl __sys_fork, __sys_clone, __sys_vfork 47.globl __sys_fork, __sys_clone, __sys_vfork
48.globl ret_from_interrupt, bad_interrupt 48.globl bad_interrupt
49.globl auto_irqhandler_fixup 49.globl auto_irqhandler_fixup
50.globl user_irqvec_fixup 50.globl user_irqvec_fixup
51 51
@@ -275,8 +275,6 @@ do_delayed_trace:
275ENTRY(auto_inthandler) 275ENTRY(auto_inthandler)
276 SAVE_ALL_INT 276 SAVE_ALL_INT
277 GET_CURRENT(%d0) 277 GET_CURRENT(%d0)
278 movel %d0,%a1
279 addqb #1,%a1@(TINFO_PREEMPT+1)
280 | put exception # in d0 278 | put exception # in d0
281 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 279 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
282 subw #VEC_SPUR,%d0 280 subw #VEC_SPUR,%d0
@@ -286,32 +284,13 @@ ENTRY(auto_inthandler)
286auto_irqhandler_fixup = . + 2 284auto_irqhandler_fixup = . + 2
287 jsr do_IRQ | process the IRQ 285 jsr do_IRQ | process the IRQ
288 addql #8,%sp | pop parameters off stack 286 addql #8,%sp | pop parameters off stack
289 287 jra ret_from_exception
290ret_from_interrupt:
291 movel %curptr@(TASK_STACK),%a1
292 subqb #1,%a1@(TINFO_PREEMPT+1)
293 jeq ret_from_last_interrupt
2942: RESTORE_ALL
295
296 ALIGN
297ret_from_last_interrupt:
298 moveq #(~ALLOWINT>>8)&0xff,%d0
299 andb %sp@(PT_OFF_SR),%d0
300 jne 2b
301
302 /* check if we need to do software interrupts */
303 tstl irq_stat+CPUSTAT_SOFTIRQ_PENDING
304 jeq .Lret_from_exception
305 pea ret_from_exception
306 jra do_softirq
307 288
308/* Handler for user defined interrupt vectors */ 289/* Handler for user defined interrupt vectors */
309 290
310ENTRY(user_inthandler) 291ENTRY(user_inthandler)
311 SAVE_ALL_INT 292 SAVE_ALL_INT
312 GET_CURRENT(%d0) 293 GET_CURRENT(%d0)
313 movel %d0,%a1
314 addqb #1,%a1@(TINFO_PREEMPT+1)
315 | put exception # in d0 294 | put exception # in d0
316 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 295 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
317user_irqvec_fixup = . + 2 296user_irqvec_fixup = . + 2
@@ -321,29 +300,18 @@ user_irqvec_fixup = . + 2
321 movel %d0,%sp@- | put vector # on stack 300 movel %d0,%sp@- | put vector # on stack
322 jsr do_IRQ | process the IRQ 301 jsr do_IRQ | process the IRQ
323 addql #8,%sp | pop parameters off stack 302 addql #8,%sp | pop parameters off stack
324 303 jra ret_from_exception
325 movel %curptr@(TASK_STACK),%a1
326 subqb #1,%a1@(TINFO_PREEMPT+1)
327 jeq ret_from_last_interrupt
328 RESTORE_ALL
329 304
330/* Handler for uninitialized and spurious interrupts */ 305/* Handler for uninitialized and spurious interrupts */
331 306
332ENTRY(bad_inthandler) 307ENTRY(bad_inthandler)
333 SAVE_ALL_INT 308 SAVE_ALL_INT
334 GET_CURRENT(%d0) 309 GET_CURRENT(%d0)
335 movel %d0,%a1
336 addqb #1,%a1@(TINFO_PREEMPT+1)
337 310
338 movel %sp,%sp@- 311 movel %sp,%sp@-
339 jsr handle_badint 312 jsr handle_badint
340 addql #4,%sp 313 addql #4,%sp
341 314 jra ret_from_exception
342 movel %curptr@(TASK_STACK),%a1
343 subqb #1,%a1@(TINFO_PREEMPT+1)
344 jeq ret_from_last_interrupt
345 RESTORE_ALL
346
347 315
348resume: 316resume:
349 /* 317 /*
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index 4d7da384eea0..077d3a70fed1 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -58,12 +58,6 @@ void __init init_IRQ(void)
58{ 58{
59 int i; 59 int i;
60 60
61 /* assembly irq entry code relies on this... */
62 if (HARDIRQ_MASK != 0x00ff0000) {
63 extern void hardirq_mask_is_broken(void);
64 hardirq_mask_is_broken();
65 }
66
67 for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++) 61 for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++)
68 irq_set_chip_and_handler(i, &auto_irq_chip, handle_simple_irq); 62 irq_set_chip_and_handler(i, &auto_irq_chip, handle_simple_irq);
69 63
diff --git a/arch/m68k/platform/68000/entry.S b/arch/m68k/platform/68000/entry.S
index 7f91c2fde509..23ac054c6e1a 100644
--- a/arch/m68k/platform/68000/entry.S
+++ b/arch/m68k/platform/68000/entry.S
@@ -27,7 +27,6 @@
27.globl ret_from_exception 27.globl ret_from_exception
28.globl ret_from_signal 28.globl ret_from_signal
29.globl sys_call_table 29.globl sys_call_table
30.globl ret_from_interrupt
31.globl bad_interrupt 30.globl bad_interrupt
32.globl inthandler1 31.globl inthandler1
33.globl inthandler2 32.globl inthandler2
@@ -137,7 +136,7 @@ inthandler1:
137 movel #65,%sp@- /* put vector # on stack*/ 136 movel #65,%sp@- /* put vector # on stack*/
138 jbsr process_int /* process the IRQ*/ 137 jbsr process_int /* process the IRQ*/
1393: addql #8,%sp /* pop parameters off stack*/ 1383: addql #8,%sp /* pop parameters off stack*/
140 bra ret_from_interrupt 139 bra ret_from_exception
141 140
142inthandler2: 141inthandler2:
143 SAVE_ALL_INT 142 SAVE_ALL_INT
@@ -148,7 +147,7 @@ inthandler2:
148 movel #66,%sp@- /* put vector # on stack*/ 147 movel #66,%sp@- /* put vector # on stack*/
149 jbsr process_int /* process the IRQ*/ 148 jbsr process_int /* process the IRQ*/
1503: addql #8,%sp /* pop parameters off stack*/ 1493: addql #8,%sp /* pop parameters off stack*/
151 bra ret_from_interrupt 150 bra ret_from_exception
152 151
153inthandler3: 152inthandler3:
154 SAVE_ALL_INT 153 SAVE_ALL_INT
@@ -159,7 +158,7 @@ inthandler3:
159 movel #67,%sp@- /* put vector # on stack*/ 158 movel #67,%sp@- /* put vector # on stack*/
160 jbsr process_int /* process the IRQ*/ 159 jbsr process_int /* process the IRQ*/
1613: addql #8,%sp /* pop parameters off stack*/ 1603: addql #8,%sp /* pop parameters off stack*/
162 bra ret_from_interrupt 161 bra ret_from_exception
163 162
164inthandler4: 163inthandler4:
165 SAVE_ALL_INT 164 SAVE_ALL_INT
@@ -170,7 +169,7 @@ inthandler4:
170 movel #68,%sp@- /* put vector # on stack*/ 169 movel #68,%sp@- /* put vector # on stack*/
171 jbsr process_int /* process the IRQ*/ 170 jbsr process_int /* process the IRQ*/
1723: addql #8,%sp /* pop parameters off stack*/ 1713: addql #8,%sp /* pop parameters off stack*/
173 bra ret_from_interrupt 172 bra ret_from_exception
174 173
175inthandler5: 174inthandler5:
176 SAVE_ALL_INT 175 SAVE_ALL_INT
@@ -181,7 +180,7 @@ inthandler5:
181 movel #69,%sp@- /* put vector # on stack*/ 180 movel #69,%sp@- /* put vector # on stack*/
182 jbsr process_int /* process the IRQ*/ 181 jbsr process_int /* process the IRQ*/
1833: addql #8,%sp /* pop parameters off stack*/ 1823: addql #8,%sp /* pop parameters off stack*/
184 bra ret_from_interrupt 183 bra ret_from_exception
185 184
186inthandler6: 185inthandler6:
187 SAVE_ALL_INT 186 SAVE_ALL_INT
@@ -192,7 +191,7 @@ inthandler6:
192 movel #70,%sp@- /* put vector # on stack*/ 191 movel #70,%sp@- /* put vector # on stack*/
193 jbsr process_int /* process the IRQ*/ 192 jbsr process_int /* process the IRQ*/
1943: addql #8,%sp /* pop parameters off stack*/ 1933: addql #8,%sp /* pop parameters off stack*/
195 bra ret_from_interrupt 194 bra ret_from_exception
196 195
197inthandler7: 196inthandler7:
198 SAVE_ALL_INT 197 SAVE_ALL_INT
@@ -203,7 +202,7 @@ inthandler7:
203 movel #71,%sp@- /* put vector # on stack*/ 202 movel #71,%sp@- /* put vector # on stack*/
204 jbsr process_int /* process the IRQ*/ 203 jbsr process_int /* process the IRQ*/
2053: addql #8,%sp /* pop parameters off stack*/ 2043: addql #8,%sp /* pop parameters off stack*/
206 bra ret_from_interrupt 205 bra ret_from_exception
207 206
208inthandler: 207inthandler:
209 SAVE_ALL_INT 208 SAVE_ALL_INT
@@ -214,23 +213,7 @@ inthandler:
214 movel %d0,%sp@- /* put vector # on stack*/ 213 movel %d0,%sp@- /* put vector # on stack*/
215 jbsr process_int /* process the IRQ*/ 214 jbsr process_int /* process the IRQ*/
2163: addql #8,%sp /* pop parameters off stack*/ 2153: addql #8,%sp /* pop parameters off stack*/
217 bra ret_from_interrupt 216 bra ret_from_exception
218
219ret_from_interrupt:
220 jeq 1f
2212:
222 RESTORE_ALL
2231:
224 moveb %sp@(PT_OFF_SR), %d0
225 and #7, %d0
226 jhi 2b
227
228 /* check if we need to do software interrupts */
229 jeq ret_from_exception
230
231 pea ret_from_exception
232 jra do_softirq
233
234 217
235/* 218/*
236 * Handler for uninitialized and spurious interrupts. 219 * Handler for uninitialized and spurious interrupts.
diff --git a/arch/m68k/platform/68360/entry.S b/arch/m68k/platform/68360/entry.S
index 904fd9a4af4e..447c33ef37fd 100644
--- a/arch/m68k/platform/68360/entry.S
+++ b/arch/m68k/platform/68360/entry.S
@@ -29,7 +29,6 @@
29.globl ret_from_exception 29.globl ret_from_exception
30.globl ret_from_signal 30.globl ret_from_signal
31.globl sys_call_table 31.globl sys_call_table
32.globl ret_from_interrupt
33.globl bad_interrupt 32.globl bad_interrupt
34.globl inthandler 33.globl inthandler
35 34
@@ -132,26 +131,9 @@ inthandler:
132 131
133 movel %sp,%sp@- 132 movel %sp,%sp@-
134 movel %d0,%sp@- /* put vector # on stack*/ 133 movel %d0,%sp@- /* put vector # on stack*/
135 jbsr do_IRQ /* process the IRQ*/ 134 jbsr do_IRQ /* process the IRQ */
1363: addql #8,%sp /* pop parameters off stack*/ 135 addql #8,%sp /* pop parameters off stack*/
137 bra ret_from_interrupt 136 jra ret_from_exception
138
139ret_from_interrupt:
140 jeq 1f
1412:
142 RESTORE_ALL
1431:
144 moveb %sp@(PT_OFF_SR), %d0
145 and #7, %d0
146 jhi 2b
147 /* check if we need to do software interrupts */
148
149 movel irq_stat+CPUSTAT_SOFTIRQ_PENDING,%d0
150 jeq ret_from_exception
151
152 pea ret_from_exception
153 jra do_softirq
154
155 137
156/* 138/*
157 * Handler for uninitialized and spurious interrupts. 139 * Handler for uninitialized and spurious interrupts.
diff --git a/arch/metag/include/asm/thread_info.h b/arch/metag/include/asm/thread_info.h
index 7c4a33006142..b19e9c588a16 100644
--- a/arch/metag/include/asm/thread_info.h
+++ b/arch/metag/include/asm/thread_info.h
@@ -46,8 +46,6 @@ struct thread_info {
46 46
47#endif 47#endif
48 48
49#define PREEMPT_ACTIVE 0x10000000
50
51#ifdef CONFIG_4KSTACKS 49#ifdef CONFIG_4KSTACKS
52#define THREAD_SHIFT 12 50#define THREAD_SHIFT 12
53#else 51#else
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index de26ea6373de..8c9d36591a03 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -106,8 +106,6 @@ static inline struct thread_info *current_thread_info(void)
106/* thread information allocation */ 106/* thread information allocation */
107#endif /* __ASSEMBLY__ */ 107#endif /* __ASSEMBLY__ */
108 108
109#define PREEMPT_ACTIVE 0x10000000
110
111/* 109/*
112 * thread information flags 110 * thread information flags
113 * - these are process state flags that various assembly files may 111 * - these are process state flags that various assembly files may
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index f9b24bfbdbae..4f58ef6d0eed 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -92,8 +92,6 @@ static inline struct thread_info *current_thread_info(void)
92 92
93#define STACK_WARN (THREAD_SIZE / 8) 93#define STACK_WARN (THREAD_SIZE / 8)
94 94
95#define PREEMPT_ACTIVE 0x10000000
96
97/* 95/*
98 * thread information flags 96 * thread information flags
99 * - these are process state flags that various assembly files may need to 97 * - these are process state flags that various assembly files may need to
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index 224b4262486d..bf280eaccd36 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -16,8 +16,6 @@
16 16
17#include <asm/page.h> 17#include <asm/page.h>
18 18
19#define PREEMPT_ACTIVE 0x10000000
20
21#ifdef CONFIG_4KSTACKS 19#ifdef CONFIG_4KSTACKS
22#define THREAD_SIZE (4096) 20#define THREAD_SIZE (4096)
23#define THREAD_SIZE_ORDER (0) 21#define THREAD_SIZE_ORDER (0)
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
index bc7cf120106b..d5f97ea3a4e1 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -46,9 +46,6 @@ struct thread_info {
46#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) 46#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
47#define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) 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 * thread information flags 50 * thread information flags
54 */ 51 */
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index ba7b1973866e..8fd6cf6dcee8 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -82,8 +82,6 @@ static inline struct thread_info *current_thread_info(void)
82 82
83#endif /* __ASSEMBLY__ */ 83#endif /* __ASSEMBLY__ */
84 84
85#define PREEMPT_ACTIVE 0x10000000
86
87/* 85/*
88 * thread information flag bit numbers 86 * thread information flag bit numbers
89 */ 87 */
diff --git a/arch/s390/include/asm/hardirq.h b/arch/s390/include/asm/hardirq.h
index a908d2941c5d..b7eabaaeffbd 100644
--- a/arch/s390/include/asm/hardirq.h
+++ b/arch/s390/include/asm/hardirq.h
@@ -18,8 +18,6 @@
18#define __ARCH_HAS_DO_SOFTIRQ 18#define __ARCH_HAS_DO_SOFTIRQ
19#define __ARCH_IRQ_EXIT_IRQS_DISABLED 19#define __ARCH_IRQ_EXIT_IRQS_DISABLED
20 20
21#define HARDIRQ_BITS 8
22
23static inline void ack_bad_irq(unsigned int irq) 21static inline void ack_bad_irq(unsigned int irq)
24{ 22{
25 printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); 23 printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index eb5f64d26d06..10e0fcd3633d 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -111,6 +111,4 @@ static inline struct thread_info *current_thread_info(void)
111#define is_32bit_task() (1) 111#define is_32bit_task() (1)
112#endif 112#endif
113 113
114#define PREEMPT_ACTIVE 0x4000000
115
116#endif /* _ASM_THREAD_INFO_H */ 114#endif /* _ASM_THREAD_INFO_H */
diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h
index 1425cc034872..656b7ada9326 100644
--- a/arch/score/include/asm/thread_info.h
+++ b/arch/score/include/asm/thread_info.h
@@ -72,8 +72,6 @@ register struct thread_info *__current_thread_info __asm__("r28");
72 72
73#endif /* !__ASSEMBLY__ */ 73#endif /* !__ASSEMBLY__ */
74 74
75#define PREEMPT_ACTIVE 0x10000000
76
77/* 75/*
78 * thread information flags 76 * thread information flags
79 * - these are process state flags that various assembly files may need to 77 * - these are process state flags that various assembly files may need to
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index 45a93669289d..ad27ffa65e2e 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -41,8 +41,6 @@ struct thread_info {
41 41
42#endif 42#endif
43 43
44#define PREEMPT_ACTIVE 0x10000000
45
46#if defined(CONFIG_4KSTACKS) 44#if defined(CONFIG_4KSTACKS)
47#define THREAD_SHIFT 12 45#define THREAD_SHIFT 12
48#else 46#else
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index 9b6e4beeb296..ca46834294b7 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -108,7 +108,7 @@ need_resched:
108 and #(0xf0>>1), r0 ! interrupts off (exception path)? 108 and #(0xf0>>1), r0 ! interrupts off (exception path)?
109 cmp/eq #(0xf0>>1), r0 109 cmp/eq #(0xf0>>1), r0
110 bt noresched 110 bt noresched
111 mov.l 3f, r0 111 mov.l 1f, r0
112 jsr @r0 ! call preempt_schedule_irq 112 jsr @r0 ! call preempt_schedule_irq
113 nop 113 nop
114 bra need_resched 114 bra need_resched
@@ -119,9 +119,7 @@ noresched:
119 nop 119 nop
120 120
121 .align 2 121 .align 2
1221: .long PREEMPT_ACTIVE 1221: .long preempt_schedule_irq
1232: .long schedule
1243: .long preempt_schedule_irq
125#endif 123#endif
126 124
127ENTRY(resume_userspace) 125ENTRY(resume_userspace)
diff --git a/arch/sparc/include/asm/hardirq_32.h b/arch/sparc/include/asm/hardirq_32.h
index 162007643cdc..ee93923b7f82 100644
--- a/arch/sparc/include/asm/hardirq_32.h
+++ b/arch/sparc/include/asm/hardirq_32.h
@@ -7,7 +7,6 @@
7#ifndef __SPARC_HARDIRQ_H 7#ifndef __SPARC_HARDIRQ_H
8#define __SPARC_HARDIRQ_H 8#define __SPARC_HARDIRQ_H
9 9
10#define HARDIRQ_BITS 8
11#include <asm-generic/hardirq.h> 10#include <asm-generic/hardirq.h>
12 11
13#endif /* __SPARC_HARDIRQ_H */ 12#endif /* __SPARC_HARDIRQ_H */
diff --git a/arch/sparc/include/asm/hardirq_64.h b/arch/sparc/include/asm/hardirq_64.h
index 7c29fd1a87aa..f478ff1ddd02 100644
--- a/arch/sparc/include/asm/hardirq_64.h
+++ b/arch/sparc/include/asm/hardirq_64.h
@@ -14,6 +14,4 @@
14 14
15void ack_bad_irq(unsigned int irq); 15void ack_bad_irq(unsigned int irq);
16 16
17#define HARDIRQ_BITS 8
18
19#endif /* !(__SPARC64_HARDIRQ_H) */ 17#endif /* !(__SPARC64_HARDIRQ_H) */
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index dd3807599bb9..96efa7adc223 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -105,8 +105,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
105#define TI_W_SAVED 0x250 105#define TI_W_SAVED 0x250
106/* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */ 106/* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */
107 107
108#define PREEMPT_ACTIVE 0x4000000
109
110/* 108/*
111 * thread information flag bit numbers 109 * thread information flag bit numbers
112 */ 110 */
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index 5d9292ab1077..a5f01ac6d0f1 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -111,8 +111,6 @@ struct thread_info {
111#define THREAD_SHIFT PAGE_SHIFT 111#define THREAD_SHIFT PAGE_SHIFT
112#endif /* PAGE_SHIFT == 13 */ 112#endif /* PAGE_SHIFT == 13 */
113 113
114#define PREEMPT_ACTIVE 0x10000000
115
116/* 114/*
117 * macros/functions for gaining access to the thread information structure 115 * macros/functions for gaining access to the thread information structure
118 */ 116 */
diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S
index a954eb81881b..39f0c662f4c8 100644
--- a/arch/sparc/kernel/rtrap_64.S
+++ b/arch/sparc/kernel/rtrap_64.S
@@ -312,12 +312,10 @@ to_kernel:
312 nop 312 nop
313 cmp %l4, 0 313 cmp %l4, 0
314 bne,pn %xcc, kern_fpucheck 314 bne,pn %xcc, kern_fpucheck
315 sethi %hi(PREEMPT_ACTIVE), %l6 315 nop
316 stw %l6, [%g6 + TI_PRE_COUNT] 316 call preempt_schedule_irq
317 call schedule
318 nop 317 nop
319 ba,pt %xcc, rtrap 318 ba,pt %xcc, rtrap
320 stw %g0, [%g6 + TI_PRE_COUNT]
321#endif 319#endif
322kern_fpucheck: ldub [%g6 + TI_FPDEPTH], %l5 320kern_fpucheck: ldub [%g6 + TI_FPDEPTH], %l5
323 brz,pt %l5, rt_continue 321 brz,pt %l5, rt_continue
diff --git a/arch/tile/include/asm/hardirq.h b/arch/tile/include/asm/hardirq.h
index 822390f9a154..54110af23985 100644
--- a/arch/tile/include/asm/hardirq.h
+++ b/arch/tile/include/asm/hardirq.h
@@ -42,6 +42,4 @@ DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
42 42
43#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 43#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
44 44
45#define HARDIRQ_BITS 8
46
47#endif /* _ASM_TILE_HARDIRQ_H */ 45#endif /* _ASM_TILE_HARDIRQ_H */
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h
index b8aa6df3e102..729aa107f64e 100644
--- a/arch/tile/include/asm/thread_info.h
+++ b/arch/tile/include/asm/thread_info.h
@@ -113,8 +113,6 @@ extern void _cpu_idle(void);
113 113
114#endif /* !__ASSEMBLY__ */ 114#endif /* !__ASSEMBLY__ */
115 115
116#define PREEMPT_ACTIVE 0x10000000
117
118/* 116/*
119 * Thread information flags that various assembly files may need to access. 117 * Thread information flags that various assembly files may need to access.
120 * Keep flags accessed frequently in low bits, particular since it makes 118 * Keep flags accessed frequently in low bits, particular since it makes
diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index 2c8eeb2df8b4..1c5b2a83046a 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void)
60 60
61#endif 61#endif
62 62
63#define PREEMPT_ACTIVE 0x10000000
64
65#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 63#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
66#define TIF_SIGPENDING 1 /* signal pending */ 64#define TIF_SIGPENDING 1 /* signal pending */
67#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 65#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h
index 818b4a1edb5b..af36d8eabdf1 100644
--- a/arch/unicore32/include/asm/thread_info.h
+++ b/arch/unicore32/include/asm/thread_info.h
@@ -118,12 +118,6 @@ static inline struct thread_info *current_thread_info(void)
118#endif 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 * thread information flags: 121 * thread information flags:
128 * TIF_SYSCALL_TRACE - syscall trace active 122 * TIF_SYSCALL_TRACE - syscall trace active
129 * TIF_SIGPENDING - signal pending 123 * TIF_SIGPENDING - signal pending
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index c46a46be1ec6..3ba3de457d05 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -153,8 +153,6 @@ struct thread_info {
153#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) 153#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
154#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) 154#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
155 155
156#define PREEMPT_ACTIVE 0x10000000
157
158#ifdef CONFIG_X86_32 156#ifdef CONFIG_X86_32
159 157
160#define STACK_WARN (THREAD_SIZE/8) 158#define STACK_WARN (THREAD_SIZE/8)
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
index 9481004ac119..470153e8547c 100644
--- a/arch/xtensa/include/asm/thread_info.h
+++ b/arch/xtensa/include/asm/thread_info.h
@@ -76,8 +76,6 @@ struct thread_info {
76 76
77#endif 77#endif
78 78
79#define PREEMPT_ACTIVE 0x10000000
80
81/* 79/*
82 * macros/functions for gaining access to the thread information structure 80 * macros/functions for gaining access to the thread information structure
83 */ 81 */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 56bb0dc8b7d4..7dc10036eff5 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -70,6 +70,9 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data);
70 * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context 70 * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context
71 * IRQ_NESTED_TRHEAD - Interrupt nests into another thread 71 * IRQ_NESTED_TRHEAD - Interrupt nests into another thread
72 * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable 72 * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable
73 * IRQ_IS_POLLED - Always polled by another interrupt. Exclude
74 * it from the spurious interrupt detection
75 * mechanism and from core side polling.
73 */ 76 */
74enum { 77enum {
75 IRQ_TYPE_NONE = 0x00000000, 78 IRQ_TYPE_NONE = 0x00000000,
@@ -94,12 +97,14 @@ enum {
94 IRQ_NESTED_THREAD = (1 << 15), 97 IRQ_NESTED_THREAD = (1 << 15),
95 IRQ_NOTHREAD = (1 << 16), 98 IRQ_NOTHREAD = (1 << 16),
96 IRQ_PER_CPU_DEVID = (1 << 17), 99 IRQ_PER_CPU_DEVID = (1 << 17),
100 IRQ_IS_POLLED = (1 << 18),
97}; 101};
98 102
99#define IRQF_MODIFY_MASK \ 103#define IRQF_MODIFY_MASK \
100 (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ 104 (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
101 IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ 105 IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
102 IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID) 106 IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \
107 IRQ_IS_POLLED)
103 108
104#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) 109#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
105 110
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h
index 931bc616219f..d169820203dd 100644
--- a/include/linux/preempt_mask.h
+++ b/include/linux/preempt_mask.h
@@ -11,36 +11,23 @@
11 * - bits 0-7 are the preemption count (max preemption depth: 256) 11 * - bits 0-7 are the preemption count (max preemption depth: 256)
12 * - bits 8-15 are the softirq count (max # of softirqs: 256) 12 * - bits 8-15 are the softirq count (max # of softirqs: 256)
13 * 13 *
14 * The hardirq count can in theory reach the same as NR_IRQS. 14 * The hardirq count could in theory be the same as the number of
15 * In reality, the number of nested IRQS is limited to the stack 15 * interrupts in the system, but we run all interrupt handlers with
16 * size as well. For archs with over 1000 IRQS it is not practical 16 * interrupts disabled, so we cannot have nesting interrupts. Though
17 * to expect that they will all nest. We give a max of 10 bits for 17 * there are a few palaeontologic drivers which reenable interrupts in
18 * hardirq nesting. An arch may choose to give less than 10 bits. 18 * the handler, so we need more than one bit here.
19 * m68k expects it to be 8.
20 * 19 *
21 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024) 20 * PREEMPT_MASK: 0x000000ff
22 * - bit 26 is the NMI_MASK 21 * SOFTIRQ_MASK: 0x0000ff00
23 * - bit 27 is the PREEMPT_ACTIVE flag 22 * HARDIRQ_MASK: 0x000f0000
24 * 23 * NMI_MASK: 0x00100000
25 * PREEMPT_MASK: 0x000000ff 24 * PREEMPT_ACTIVE: 0x00200000
26 * SOFTIRQ_MASK: 0x0000ff00
27 * HARDIRQ_MASK: 0x03ff0000
28 * NMI_MASK: 0x04000000
29 */ 25 */
30#define PREEMPT_BITS 8 26#define PREEMPT_BITS 8
31#define SOFTIRQ_BITS 8 27#define SOFTIRQ_BITS 8
28#define HARDIRQ_BITS 4
32#define NMI_BITS 1 29#define NMI_BITS 1
33 30
34#define MAX_HARDIRQ_BITS 10
35
36#ifndef HARDIRQ_BITS
37# define HARDIRQ_BITS MAX_HARDIRQ_BITS
38#endif
39
40#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
41#error HARDIRQ_BITS too high!
42#endif
43
44#define PREEMPT_SHIFT 0 31#define PREEMPT_SHIFT 0
45#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) 32#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
46#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) 33#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
@@ -60,15 +47,9 @@
60 47
61#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) 48#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
62 49
63#ifndef PREEMPT_ACTIVE
64#define PREEMPT_ACTIVE_BITS 1 50#define PREEMPT_ACTIVE_BITS 1
65#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) 51#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
66#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) 52#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
67#endif
68
69#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
70#error PREEMPT_ACTIVE is too low!
71#endif
72 53
73#define hardirq_count() (preempt_count() & HARDIRQ_MASK) 54#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
74#define softirq_count() (preempt_count() & SOFTIRQ_MASK) 55#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6f7ffa460089..7e35d4b9e14a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -22,7 +22,7 @@ struct sched_param {
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/nodemask.h> 23#include <linux/nodemask.h>
24#include <linux/mm_types.h> 24#include <linux/mm_types.h>
25#include <linux/preempt.h> 25#include <linux/preempt_mask.h>
26 26
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/ptrace.h> 28#include <asm/ptrace.h>
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h
index 1162f1030f18..3320b84cc60f 100644
--- a/kernel/irq/settings.h
+++ b/kernel/irq/settings.h
@@ -14,6 +14,7 @@ enum {
14 _IRQ_NO_BALANCING = IRQ_NO_BALANCING, 14 _IRQ_NO_BALANCING = IRQ_NO_BALANCING,
15 _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD, 15 _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD,
16 _IRQ_PER_CPU_DEVID = IRQ_PER_CPU_DEVID, 16 _IRQ_PER_CPU_DEVID = IRQ_PER_CPU_DEVID,
17 _IRQ_IS_POLLED = IRQ_IS_POLLED,
17 _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK, 18 _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK,
18}; 19};
19 20
@@ -26,6 +27,7 @@ enum {
26#define IRQ_NOAUTOEN GOT_YOU_MORON 27#define IRQ_NOAUTOEN GOT_YOU_MORON
27#define IRQ_NESTED_THREAD GOT_YOU_MORON 28#define IRQ_NESTED_THREAD GOT_YOU_MORON
28#define IRQ_PER_CPU_DEVID GOT_YOU_MORON 29#define IRQ_PER_CPU_DEVID GOT_YOU_MORON
30#define IRQ_IS_POLLED GOT_YOU_MORON
29#undef IRQF_MODIFY_MASK 31#undef IRQF_MODIFY_MASK
30#define IRQF_MODIFY_MASK GOT_YOU_MORON 32#define IRQF_MODIFY_MASK GOT_YOU_MORON
31 33
@@ -147,3 +149,8 @@ static inline bool irq_settings_is_nested_thread(struct irq_desc *desc)
147{ 149{
148 return desc->status_use_accessors & _IRQ_NESTED_THREAD; 150 return desc->status_use_accessors & _IRQ_NESTED_THREAD;
149} 151}
152
153static inline bool irq_settings_is_polled(struct irq_desc *desc)
154{
155 return desc->status_use_accessors & _IRQ_IS_POLLED;
156}
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index 7b5f012bde9d..a1d8cc63b56e 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -67,8 +67,13 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
67 67
68 raw_spin_lock(&desc->lock); 68 raw_spin_lock(&desc->lock);
69 69
70 /* PER_CPU and nested thread interrupts are never polled */ 70 /*
71 if (irq_settings_is_per_cpu(desc) || irq_settings_is_nested_thread(desc)) 71 * PER_CPU, nested thread interrupts and interrupts explicitely
72 * marked polled are excluded from polling.
73 */
74 if (irq_settings_is_per_cpu(desc) ||
75 irq_settings_is_nested_thread(desc) ||
76 irq_settings_is_polled(desc))
72 goto out; 77 goto out;
73 78
74 /* 79 /*
@@ -268,7 +273,8 @@ try_misrouted_irq(unsigned int irq, struct irq_desc *desc,
268void note_interrupt(unsigned int irq, struct irq_desc *desc, 273void note_interrupt(unsigned int irq, struct irq_desc *desc,
269 irqreturn_t action_ret) 274 irqreturn_t action_ret)
270{ 275{
271 if (desc->istate & IRQS_POLL_INPROGRESS) 276 if (desc->istate & IRQS_POLL_INPROGRESS ||
277 irq_settings_is_polled(desc))
272 return; 278 return;
273 279
274 /* we get here again via the threaded handler */ 280 /* we get here again via the threaded handler */