diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-07-07 09:07:18 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-07-13 16:26:09 -0400 |
commit | 192ef366198ce16c0379100565cdc5b7bd68511f (patch) | |
tree | 1f4ef0a9ee796fbf970b6f0703aa31ecad584ee1 | |
parent | 8d197f3d17d4f43eb7d032491af7fc959cbed4fa (diff) |
[MIPS] TRACE_IRQFLAGS_SUPPORT support.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/Kconfig.debug | 4 | ||||
-rw-r--r-- | arch/mips/kernel/entry.S | 15 | ||||
-rw-r--r-- | arch/mips/kernel/gdb-low.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/genex.S | 6 | ||||
-rw-r--r-- | arch/mips/kernel/head.S | 3 | ||||
-rw-r--r-- | arch/mips/kernel/scall32-o32.S | 15 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-64.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/smtc-asm.S | 1 | ||||
-rw-r--r-- | include/asm-mips/atomic.h | 2 | ||||
-rw-r--r-- | include/asm-mips/bitops.h | 2 | ||||
-rw-r--r-- | include/asm-mips/irqflags.h (renamed from include/asm-mips/interrupt.h) | 70 | ||||
-rw-r--r-- | include/asm-mips/mipsregs.h | 2 | ||||
-rw-r--r-- | include/asm-mips/system.h | 2 |
15 files changed, 91 insertions, 39 deletions
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 515f9e611307..5d6afb52d904 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug | |||
@@ -1,5 +1,9 @@ | |||
1 | menu "Kernel hacking" | 1 | menu "Kernel hacking" |
2 | 2 | ||
3 | config TRACE_IRQFLAGS_SUPPORT | ||
4 | bool | ||
5 | default y | ||
6 | |||
3 | source "lib/Kconfig.debug" | 7 | source "lib/Kconfig.debug" |
4 | 8 | ||
5 | config CROSSCOMPILE | 9 | config CROSSCOMPILE |
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index 01e7fa86aa43..766655f35250 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S | |||
@@ -113,6 +113,21 @@ FEXPORT(restore_all) # restore full frame | |||
113 | RESTORE_AT | 113 | RESTORE_AT |
114 | RESTORE_STATIC | 114 | RESTORE_STATIC |
115 | FEXPORT(restore_partial) # restore partial frame | 115 | FEXPORT(restore_partial) # restore partial frame |
116 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
117 | SAVE_STATIC | ||
118 | SAVE_AT | ||
119 | SAVE_TEMP | ||
120 | LONG_L v0, PT_STATUS(sp) | ||
121 | and v0, 1 | ||
122 | beqz v0, 1f | ||
123 | jal trace_hardirqs_on | ||
124 | b 2f | ||
125 | 1: jal trace_hardirqs_off | ||
126 | 2: | ||
127 | RESTORE_TEMP | ||
128 | RESTORE_AT | ||
129 | RESTORE_STATIC | ||
130 | #endif | ||
116 | RESTORE_SOME | 131 | RESTORE_SOME |
117 | RESTORE_SP_AND_RET | 132 | RESTORE_SP_AND_RET |
118 | .set at | 133 | .set at |
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S index 666bc9014cbd..2c446063636a 100644 --- a/arch/mips/kernel/gdb-low.S +++ b/arch/mips/kernel/gdb-low.S | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | #include <asm/asm.h> | 8 | #include <asm/asm.h> |
9 | #include <asm/errno.h> | 9 | #include <asm/errno.h> |
10 | #include <asm/irqflags.h> | ||
10 | #include <asm/mipsregs.h> | 11 | #include <asm/mipsregs.h> |
11 | #include <asm/regdef.h> | 12 | #include <asm/regdef.h> |
12 | #include <asm/stackframe.h> | 13 | #include <asm/stackframe.h> |
@@ -120,6 +121,7 @@ | |||
120 | LONG_S $31, GDB_FR_REG31(sp) | 121 | LONG_S $31, GDB_FR_REG31(sp) |
121 | 122 | ||
122 | CLI /* disable interrupts */ | 123 | CLI /* disable interrupts */ |
124 | TRACE_IRQS_OFF | ||
123 | 125 | ||
124 | /* | 126 | /* |
125 | * Followed by the floating point registers | 127 | * Followed by the floating point registers |
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index b563811b1b27..37fda3dcdfc5 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/asm.h> | 13 | #include <asm/asm.h> |
14 | #include <asm/asmmacro.h> | 14 | #include <asm/asmmacro.h> |
15 | #include <asm/cacheops.h> | 15 | #include <asm/cacheops.h> |
16 | #include <asm/irqflags.h> | ||
16 | #include <asm/regdef.h> | 17 | #include <asm/regdef.h> |
17 | #include <asm/fpregdef.h> | 18 | #include <asm/fpregdef.h> |
18 | #include <asm/mipsregs.h> | 19 | #include <asm/mipsregs.h> |
@@ -128,6 +129,7 @@ handle_vcei: | |||
128 | NESTED(handle_int, PT_SIZE, sp) | 129 | NESTED(handle_int, PT_SIZE, sp) |
129 | SAVE_ALL | 130 | SAVE_ALL |
130 | CLI | 131 | CLI |
132 | TRACE_IRQS_OFF | ||
131 | 133 | ||
132 | PTR_LA ra, ret_from_irq | 134 | PTR_LA ra, ret_from_irq |
133 | move a0, sp | 135 | move a0, sp |
@@ -216,6 +218,7 @@ NESTED(except_vec_vi_handler, 0, sp) | |||
216 | _ehb | 218 | _ehb |
217 | #endif /* CONFIG_MIPS_MT_SMTC */ | 219 | #endif /* CONFIG_MIPS_MT_SMTC */ |
218 | CLI | 220 | CLI |
221 | TRACE_IRQS_OFF | ||
219 | move a0, sp | 222 | move a0, sp |
220 | jalr v0 | 223 | jalr v0 |
221 | j ret_from_irq | 224 | j ret_from_irq |
@@ -288,11 +291,13 @@ NESTED(nmi_handler, PT_SIZE, sp) | |||
288 | .endm | 291 | .endm |
289 | 292 | ||
290 | .macro __build_clear_sti | 293 | .macro __build_clear_sti |
294 | TRACE_IRQS_ON | ||
291 | STI | 295 | STI |
292 | .endm | 296 | .endm |
293 | 297 | ||
294 | .macro __build_clear_cli | 298 | .macro __build_clear_cli |
295 | CLI | 299 | CLI |
300 | TRACE_IRQS_OFF | ||
296 | .endm | 301 | .endm |
297 | 302 | ||
298 | .macro __build_clear_fpe | 303 | .macro __build_clear_fpe |
@@ -300,6 +305,7 @@ NESTED(nmi_handler, PT_SIZE, sp) | |||
300 | li a2, ~(0x3f << 12) | 305 | li a2, ~(0x3f << 12) |
301 | and a2, a1 | 306 | and a2, a1 |
302 | ctc1 a2, fcr31 | 307 | ctc1 a2, fcr31 |
308 | TRACE_IRQS_ON | ||
303 | STI | 309 | STI |
304 | .endm | 310 | .endm |
305 | 311 | ||
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index 476c1eb33c94..8c6db0fc72f0 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 1994, 1995 Waldorf Electronics | 6 | * Copyright (C) 1994, 1995 Waldorf Electronics |
7 | * Written by Ralf Baechle and Andreas Busse | 7 | * Written by Ralf Baechle and Andreas Busse |
8 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 Ralf Baechle | 8 | * Copyright (C) 1994 - 99, 2003, 06 Ralf Baechle |
9 | * Copyright (C) 1996 Paul M. Antoine | 9 | * Copyright (C) 1996 Paul M. Antoine |
10 | * Modified for DECStation and hence R3000 support by Paul M. Antoine | 10 | * Modified for DECStation and hence R3000 support by Paul M. Antoine |
11 | * Further modifications by David S. Miller and Harald Koerfgen | 11 | * Further modifications by David S. Miller and Harald Koerfgen |
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <asm/asm.h> | 19 | #include <asm/asm.h> |
20 | #include <asm/asmmacro.h> | 20 | #include <asm/asmmacro.h> |
21 | #include <asm/irqflags.h> | ||
21 | #include <asm/regdef.h> | 22 | #include <asm/regdef.h> |
22 | #include <asm/page.h> | 23 | #include <asm/page.h> |
23 | #include <asm/mipsregs.h> | 24 | #include <asm/mipsregs.h> |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index c8e5f9c9a113..ba1bcd83c7d3 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -3,13 +3,14 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 by Ralf Baechle | 6 | * Copyright (C) 1995-99, 2000- 02, 06 Ralf Baechle <ralf@linux-mips.org> |
7 | * Copyright (C) 2001 MIPS Technologies, Inc. | 7 | * Copyright (C) 2001 MIPS Technologies, Inc. |
8 | * Copyright (C) 2004 Thiemo Seufer | 8 | * Copyright (C) 2004 Thiemo Seufer |
9 | */ | 9 | */ |
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <asm/asm.h> | 11 | #include <asm/asm.h> |
12 | #include <asm/asmmacro.h> | 12 | #include <asm/asmmacro.h> |
13 | #include <asm/irqflags.h> | ||
13 | #include <asm/mipsregs.h> | 14 | #include <asm/mipsregs.h> |
14 | #include <asm/regdef.h> | 15 | #include <asm/regdef.h> |
15 | #include <asm/stackframe.h> | 16 | #include <asm/stackframe.h> |
@@ -27,6 +28,18 @@ | |||
27 | NESTED(handle_sys, PT_SIZE, sp) | 28 | NESTED(handle_sys, PT_SIZE, sp) |
28 | .set noat | 29 | .set noat |
29 | SAVE_SOME | 30 | SAVE_SOME |
31 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
32 | TRACE_IRQS_ON | ||
33 | #ifdef CONFIG_64BIT | ||
34 | LONG_L $8, PT_R8(sp) | ||
35 | LONG_L $9, PT_R9(sp) | ||
36 | #endif | ||
37 | LONG_L $7, PT_R7(sp) | ||
38 | LONG_L $6, PT_R6(sp) | ||
39 | LONG_L $5, PT_R5(sp) | ||
40 | LONG_L $4, PT_R4(sp) | ||
41 | LONG_L $2, PT_R2(sp) | ||
42 | #endif | ||
30 | STI | 43 | STI |
31 | .set at | 44 | .set at |
32 | 45 | ||
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 809fd1b55f84..939e172db953 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <asm/asm.h> | 11 | #include <asm/asm.h> |
12 | #include <asm/asmmacro.h> | 12 | #include <asm/asmmacro.h> |
13 | #include <asm/irqflags.h> | ||
13 | #include <asm/mipsregs.h> | 14 | #include <asm/mipsregs.h> |
14 | #include <asm/regdef.h> | 15 | #include <asm/regdef.h> |
15 | #include <asm/stackframe.h> | 16 | #include <asm/stackframe.h> |
@@ -33,6 +34,7 @@ NESTED(handle_sys64, PT_SIZE, sp) | |||
33 | */ | 34 | */ |
34 | .set noat | 35 | .set noat |
35 | SAVE_SOME | 36 | SAVE_SOME |
37 | TRACE_IRQS_ON | ||
36 | STI | 38 | STI |
37 | .set at | 39 | .set at |
38 | #endif | 40 | #endif |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index b2b5cb9fe571..98abbc5a9f13 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <asm/asm.h> | 11 | #include <asm/asm.h> |
12 | #include <asm/asmmacro.h> | 12 | #include <asm/asmmacro.h> |
13 | #include <asm/irqflags.h> | ||
13 | #include <asm/mipsregs.h> | 14 | #include <asm/mipsregs.h> |
14 | #include <asm/regdef.h> | 15 | #include <asm/regdef.h> |
15 | #include <asm/stackframe.h> | 16 | #include <asm/stackframe.h> |
@@ -32,6 +33,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) | |||
32 | #ifndef CONFIG_MIPS32_O32 | 33 | #ifndef CONFIG_MIPS32_O32 |
33 | .set noat | 34 | .set noat |
34 | SAVE_SOME | 35 | SAVE_SOME |
36 | TRACE_IRQS_ON | ||
35 | STI | 37 | STI |
36 | .set at | 38 | .set at |
37 | #endif | 39 | #endif |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 3a138dcc8827..505c9ee54009 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <asm/asm.h> | 17 | #include <asm/asm.h> |
18 | #include <asm/asmmacro.h> | 18 | #include <asm/asmmacro.h> |
19 | #include <asm/irqflags.h> | ||
19 | #include <asm/mipsregs.h> | 20 | #include <asm/mipsregs.h> |
20 | #include <asm/regdef.h> | 21 | #include <asm/regdef.h> |
21 | #include <asm/stackframe.h> | 22 | #include <asm/stackframe.h> |
@@ -27,6 +28,7 @@ | |||
27 | NESTED(handle_sys, PT_SIZE, sp) | 28 | NESTED(handle_sys, PT_SIZE, sp) |
28 | .set noat | 29 | .set noat |
29 | SAVE_SOME | 30 | SAVE_SOME |
31 | TRACE_IRQS_ON | ||
30 | STI | 32 | STI |
31 | .set at | 33 | .set at |
32 | ld t1, PT_EPC(sp) # skip syscall on return | 34 | ld t1, PT_EPC(sp) # skip syscall on return |
diff --git a/arch/mips/kernel/smtc-asm.S b/arch/mips/kernel/smtc-asm.S index 72c6d98f8854..4cc3dea36612 100644 --- a/arch/mips/kernel/smtc-asm.S +++ b/arch/mips/kernel/smtc-asm.S | |||
@@ -96,6 +96,7 @@ FEXPORT(__smtc_ipi_vector) | |||
96 | /* Save all will redundantly recompute the SP, but use it for now */ | 96 | /* Save all will redundantly recompute the SP, but use it for now */ |
97 | SAVE_ALL | 97 | SAVE_ALL |
98 | CLI | 98 | CLI |
99 | TRACE_IRQS_OFF | ||
99 | move a0,sp | 100 | move a0,sp |
100 | /* Function to be invoked passed stack pad slot 5 */ | 101 | /* Function to be invoked passed stack pad slot 5 */ |
101 | lw t0,PT_PADSLOT5(sp) | 102 | lw t0,PT_PADSLOT5(sp) |
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index 13d44e14025a..e64abc0d8221 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h | |||
@@ -22,8 +22,8 @@ | |||
22 | #ifndef _ASM_ATOMIC_H | 22 | #ifndef _ASM_ATOMIC_H |
23 | #define _ASM_ATOMIC_H | 23 | #define _ASM_ATOMIC_H |
24 | 24 | ||
25 | #include <linux/irqflags.h> | ||
25 | #include <asm/cpu-features.h> | 26 | #include <asm/cpu-features.h> |
26 | #include <asm/interrupt.h> | ||
27 | #include <asm/war.h> | 27 | #include <asm/war.h> |
28 | 28 | ||
29 | typedef struct { volatile int counter; } atomic_t; | 29 | typedef struct { volatile int counter; } atomic_t; |
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 098cec263681..1bb89c5a10ee 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | #ifdef __KERNEL__ | 32 | #ifdef __KERNEL__ |
33 | 33 | ||
34 | #include <asm/interrupt.h> | 34 | #include <linux/irqflags.h> |
35 | #include <asm/sgidefs.h> | 35 | #include <asm/sgidefs.h> |
36 | #include <asm/war.h> | 36 | #include <asm/war.h> |
37 | 37 | ||
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/irqflags.h index a99d6867510f..43ca09a3a3d0 100644 --- a/include/asm-mips/interrupt.h +++ b/include/asm-mips/irqflags.h | |||
@@ -8,13 +8,15 @@ | |||
8 | * Copyright (C) 1999 Silicon Graphics | 8 | * Copyright (C) 1999 Silicon Graphics |
9 | * Copyright (C) 2000 MIPS Technologies, Inc. | 9 | * Copyright (C) 2000 MIPS Technologies, Inc. |
10 | */ | 10 | */ |
11 | #ifndef _ASM_INTERRUPT_H | 11 | #ifndef _ASM_IRQFLAGS_H |
12 | #define _ASM_INTERRUPT_H | 12 | #define _ASM_IRQFLAGS_H |
13 | |||
14 | #ifndef __ASSEMBLY__ | ||
13 | 15 | ||
14 | #include <asm/hazards.h> | 16 | #include <asm/hazards.h> |
15 | 17 | ||
16 | __asm__ ( | 18 | __asm__ ( |
17 | " .macro local_irq_enable \n" | 19 | " .macro raw_local_irq_enable \n" |
18 | " .set push \n" | 20 | " .set push \n" |
19 | " .set reorder \n" | 21 | " .set reorder \n" |
20 | " .set noat \n" | 22 | " .set noat \n" |
@@ -35,10 +37,10 @@ __asm__ ( | |||
35 | " .set pop \n" | 37 | " .set pop \n" |
36 | " .endm"); | 38 | " .endm"); |
37 | 39 | ||
38 | static inline void local_irq_enable(void) | 40 | static inline void raw_local_irq_enable(void) |
39 | { | 41 | { |
40 | __asm__ __volatile__( | 42 | __asm__ __volatile__( |
41 | "local_irq_enable" | 43 | "raw_local_irq_enable" |
42 | : /* no outputs */ | 44 | : /* no outputs */ |
43 | : /* no inputs */ | 45 | : /* no inputs */ |
44 | : "memory"); | 46 | : "memory"); |
@@ -63,7 +65,7 @@ static inline void local_irq_enable(void) | |||
63 | * Workaround: mask EXL bit of the result or place a nop before mfc0. | 65 | * Workaround: mask EXL bit of the result or place a nop before mfc0. |
64 | */ | 66 | */ |
65 | __asm__ ( | 67 | __asm__ ( |
66 | " .macro local_irq_disable\n" | 68 | " .macro raw_local_irq_disable\n" |
67 | " .set push \n" | 69 | " .set push \n" |
68 | " .set noat \n" | 70 | " .set noat \n" |
69 | #ifdef CONFIG_MIPS_MT_SMTC | 71 | #ifdef CONFIG_MIPS_MT_SMTC |
@@ -84,17 +86,17 @@ __asm__ ( | |||
84 | " .set pop \n" | 86 | " .set pop \n" |
85 | " .endm \n"); | 87 | " .endm \n"); |
86 | 88 | ||
87 | static inline void local_irq_disable(void) | 89 | static inline void raw_local_irq_disable(void) |
88 | { | 90 | { |
89 | __asm__ __volatile__( | 91 | __asm__ __volatile__( |
90 | "local_irq_disable" | 92 | "raw_local_irq_disable" |
91 | : /* no outputs */ | 93 | : /* no outputs */ |
92 | : /* no inputs */ | 94 | : /* no inputs */ |
93 | : "memory"); | 95 | : "memory"); |
94 | } | 96 | } |
95 | 97 | ||
96 | __asm__ ( | 98 | __asm__ ( |
97 | " .macro local_save_flags flags \n" | 99 | " .macro raw_local_save_flags flags \n" |
98 | " .set push \n" | 100 | " .set push \n" |
99 | " .set reorder \n" | 101 | " .set reorder \n" |
100 | #ifdef CONFIG_MIPS_MT_SMTC | 102 | #ifdef CONFIG_MIPS_MT_SMTC |
@@ -105,13 +107,13 @@ __asm__ ( | |||
105 | " .set pop \n" | 107 | " .set pop \n" |
106 | " .endm \n"); | 108 | " .endm \n"); |
107 | 109 | ||
108 | #define local_save_flags(x) \ | 110 | #define raw_local_save_flags(x) \ |
109 | __asm__ __volatile__( \ | 111 | __asm__ __volatile__( \ |
110 | "local_save_flags %0" \ | 112 | "raw_local_save_flags %0" \ |
111 | : "=r" (x)) | 113 | : "=r" (x)) |
112 | 114 | ||
113 | __asm__ ( | 115 | __asm__ ( |
114 | " .macro local_irq_save result \n" | 116 | " .macro raw_local_irq_save result \n" |
115 | " .set push \n" | 117 | " .set push \n" |
116 | " .set reorder \n" | 118 | " .set reorder \n" |
117 | " .set noat \n" | 119 | " .set noat \n" |
@@ -135,15 +137,15 @@ __asm__ ( | |||
135 | " .set pop \n" | 137 | " .set pop \n" |
136 | " .endm \n"); | 138 | " .endm \n"); |
137 | 139 | ||
138 | #define local_irq_save(x) \ | 140 | #define raw_local_irq_save(x) \ |
139 | __asm__ __volatile__( \ | 141 | __asm__ __volatile__( \ |
140 | "local_irq_save\t%0" \ | 142 | "raw_local_irq_save\t%0" \ |
141 | : "=r" (x) \ | 143 | : "=r" (x) \ |
142 | : /* no inputs */ \ | 144 | : /* no inputs */ \ |
143 | : "memory") | 145 | : "memory") |
144 | 146 | ||
145 | __asm__ ( | 147 | __asm__ ( |
146 | " .macro local_irq_restore flags \n" | 148 | " .macro raw_local_irq_restore flags \n" |
147 | " .set push \n" | 149 | " .set push \n" |
148 | " .set noreorder \n" | 150 | " .set noreorder \n" |
149 | " .set noat \n" | 151 | " .set noat \n" |
@@ -182,40 +184,42 @@ __asm__ ( | |||
182 | " .set pop \n" | 184 | " .set pop \n" |
183 | " .endm \n"); | 185 | " .endm \n"); |
184 | 186 | ||
185 | #define local_irq_restore(flags) \ | 187 | #define raw_local_irq_restore(flags) \ |
186 | do { \ | 188 | do { \ |
187 | unsigned long __tmp1; \ | 189 | unsigned long __tmp1; \ |
188 | \ | 190 | \ |
189 | __asm__ __volatile__( \ | 191 | __asm__ __volatile__( \ |
190 | "local_irq_restore\t%0" \ | 192 | "raw_local_irq_restore\t%0" \ |
191 | : "=r" (__tmp1) \ | 193 | : "=r" (__tmp1) \ |
192 | : "0" (flags) \ | 194 | : "0" (flags) \ |
193 | : "memory"); \ | 195 | : "memory"); \ |
194 | } while(0) | 196 | } while(0) |
195 | 197 | ||
196 | static inline int irqs_disabled(void) | 198 | static inline int raw_irqs_disabled_flags(unsigned long flags) |
197 | { | 199 | { |
198 | #ifdef CONFIG_MIPS_MT_SMTC | 200 | #ifdef CONFIG_MIPS_MT_SMTC |
199 | /* | 201 | /* |
200 | * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU | 202 | * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU |
201 | */ | 203 | */ |
202 | unsigned long __result; | 204 | return flags & 0x400; |
203 | |||
204 | __asm__ __volatile__( | ||
205 | " .set noreorder \n" | ||
206 | " mfc0 %0, $2, 1 \n" | ||
207 | " andi %0, 0x400 \n" | ||
208 | " slt %0, $0, %0 \n" | ||
209 | " .set reorder \n" | ||
210 | : "=r" (__result)); | ||
211 | |||
212 | return __result; | ||
213 | #else | 205 | #else |
214 | unsigned long flags; | ||
215 | local_save_flags(flags); | ||
216 | |||
217 | return !(flags & 1); | 206 | return !(flags & 1); |
218 | #endif | 207 | #endif |
219 | } | 208 | } |
220 | 209 | ||
221 | #endif /* _ASM_INTERRUPT_H */ | 210 | #endif |
211 | |||
212 | /* | ||
213 | * Do the CPU's IRQ-state tracing from assembly code. | ||
214 | */ | ||
215 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
216 | # define TRACE_IRQS_ON \ | ||
217 | jal trace_hardirqs_on | ||
218 | # define TRACE_IRQS_OFF \ | ||
219 | jal trace_hardirqs_off | ||
220 | #else | ||
221 | # define TRACE_IRQS_ON | ||
222 | # define TRACE_IRQS_OFF | ||
223 | #endif | ||
224 | |||
225 | #endif /* _ASM_IRQFLAGS_H */ | ||
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index b4169f0fb13b..677668867b9d 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -1417,7 +1417,7 @@ change_c0_##name(unsigned int change, unsigned int new) \ | |||
1417 | 1417 | ||
1418 | #else /* SMTC versions that manage MT scheduling */ | 1418 | #else /* SMTC versions that manage MT scheduling */ |
1419 | 1419 | ||
1420 | #include <asm/interrupt.h> | 1420 | #include <linux/irqflags.h> |
1421 | 1421 | ||
1422 | /* | 1422 | /* |
1423 | * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with | 1423 | * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with |
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 130333d7c4ee..13c98dde82dc 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -13,13 +13,13 @@ | |||
13 | #define _ASM_SYSTEM_H | 13 | #define _ASM_SYSTEM_H |
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/irqflags.h> | ||
16 | 17 | ||
17 | #include <asm/addrspace.h> | 18 | #include <asm/addrspace.h> |
18 | #include <asm/cpu-features.h> | 19 | #include <asm/cpu-features.h> |
19 | #include <asm/dsp.h> | 20 | #include <asm/dsp.h> |
20 | #include <asm/ptrace.h> | 21 | #include <asm/ptrace.h> |
21 | #include <asm/war.h> | 22 | #include <asm/war.h> |
22 | #include <asm/interrupt.h> | ||
23 | 23 | ||
24 | /* | 24 | /* |
25 | * read_barrier_depends - Flush all pending reads that subsequents reads | 25 | * read_barrier_depends - Flush all pending reads that subsequents reads |