Skip to content

Commit 192ef36

Browse files
committed
[MIPS] TRACE_IRQFLAGS_SUPPORT support.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 8d197f3 commit 192ef36

15 files changed

Lines changed: 91 additions & 39 deletions

File tree

‎arch/mips/Kconfig.debug‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
menu "Kernel hacking"
22

3+
config TRACE_IRQFLAGS_SUPPORT
4+
bool
5+
default y
6+
37
source "lib/Kconfig.debug"
48

59
config CROSSCOMPILE

‎arch/mips/kernel/entry.S‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ FEXPORT(restore_all) # restore full frame
113113
RESTORE_AT
114114
RESTORE_STATIC
115115
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
116131
RESTORE_SOME
117132
RESTORE_SP_AND_RET
118133
.set at

‎arch/mips/kernel/gdb-low.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <asm/asm.h>
99
#include <asm/errno.h>
10+
#include <asm/irqflags.h>
1011
#include <asm/mipsregs.h>
1112
#include <asm/regdef.h>
1213
#include <asm/stackframe.h>
@@ -120,6 +121,7 @@
120121
LONG_S $31, GDB_FR_REG31(sp)
121122

122123
CLI /* disable interrupts */
124+
TRACE_IRQS_OFF
123125

124126
/*
125127
* Followed by the floating point registers

‎arch/mips/kernel/genex.S‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <asm/asm.h>
1414
#include <asm/asmmacro.h>
1515
#include <asm/cacheops.h>
16+
#include <asm/irqflags.h>
1617
#include <asm/regdef.h>
1718
#include <asm/fpregdef.h>
1819
#include <asm/mipsregs.h>
@@ -128,6 +129,7 @@ handle_vcei:
128129
NESTED(handle_int, PT_SIZE, sp)
129130
SAVE_ALL
130131
CLI
132+
TRACE_IRQS_OFF
131133

132134
PTR_LA ra, ret_from_irq
133135
move a0, sp
@@ -216,6 +218,7 @@ NESTED(except_vec_vi_handler, 0, sp)
216218
_ehb
217219
#endif /* CONFIG_MIPS_MT_SMTC */
218220
CLI
221+
TRACE_IRQS_OFF
219222
move a0, sp
220223
jalr v0
221224
j ret_from_irq
@@ -288,18 +291,21 @@ NESTED(nmi_handler, PT_SIZE, sp)
288291
.endm
289292

290293
.macro __build_clear_sti
294+
TRACE_IRQS_ON
291295
STI
292296
.endm
293297

294298
.macro __build_clear_cli
295299
CLI
300+
TRACE_IRQS_OFF
296301
.endm
297302

298303
.macro __build_clear_fpe
299304
cfc1 a1, fcr31
300305
li a2, ~(0x3f << 12)
301306
and a2, a1
302307
ctc1 a2, fcr31
308+
TRACE_IRQS_ON
303309
STI
304310
.endm
305311

‎arch/mips/kernel/head.S‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (C) 1994, 1995 Waldorf Electronics
77
* 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
99
* Copyright (C) 1996 Paul M. Antoine
1010
* Modified for DECStation and hence R3000 support by Paul M. Antoine
1111
* Further modifications by David S. Miller and Harald Koerfgen
@@ -18,6 +18,7 @@
1818

1919
#include <asm/asm.h>
2020
#include <asm/asmmacro.h>
21+
#include <asm/irqflags.h>
2122
#include <asm/regdef.h>
2223
#include <asm/page.h>
2324
#include <asm/mipsregs.h>

‎arch/mips/kernel/scall32-o32.S‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
* License. See the file "COPYING" in the main directory of this archive
44
* for more details.
55
*
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>
77
* Copyright (C) 2001 MIPS Technologies, Inc.
88
* Copyright (C) 2004 Thiemo Seufer
99
*/
1010
#include <linux/errno.h>
1111
#include <asm/asm.h>
1212
#include <asm/asmmacro.h>
13+
#include <asm/irqflags.h>
1314
#include <asm/mipsregs.h>
1415
#include <asm/regdef.h>
1516
#include <asm/stackframe.h>
@@ -27,6 +28,18 @@
2728
NESTED(handle_sys, PT_SIZE, sp)
2829
.set noat
2930
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
3043
STI
3144
.set at
3245

‎arch/mips/kernel/scall64-64.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/errno.h>
1111
#include <asm/asm.h>
1212
#include <asm/asmmacro.h>
13+
#include <asm/irqflags.h>
1314
#include <asm/mipsregs.h>
1415
#include <asm/regdef.h>
1516
#include <asm/stackframe.h>
@@ -33,6 +34,7 @@ NESTED(handle_sys64, PT_SIZE, sp)
3334
*/
3435
.set noat
3536
SAVE_SOME
37+
TRACE_IRQS_ON
3638
STI
3739
.set at
3840
#endif

‎arch/mips/kernel/scall64-n32.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/errno.h>
1111
#include <asm/asm.h>
1212
#include <asm/asmmacro.h>
13+
#include <asm/irqflags.h>
1314
#include <asm/mipsregs.h>
1415
#include <asm/regdef.h>
1516
#include <asm/stackframe.h>
@@ -32,6 +33,7 @@ NESTED(handle_sysn32, PT_SIZE, sp)
3233
#ifndef CONFIG_MIPS32_O32
3334
.set noat
3435
SAVE_SOME
36+
TRACE_IRQS_ON
3537
STI
3638
.set at
3739
#endif

‎arch/mips/kernel/scall64-o32.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/errno.h>
1717
#include <asm/asm.h>
1818
#include <asm/asmmacro.h>
19+
#include <asm/irqflags.h>
1920
#include <asm/mipsregs.h>
2021
#include <asm/regdef.h>
2122
#include <asm/stackframe.h>
@@ -27,6 +28,7 @@
2728
NESTED(handle_sys, PT_SIZE, sp)
2829
.set noat
2930
SAVE_SOME
31+
TRACE_IRQS_ON
3032
STI
3133
.set at
3234
ld t1, PT_EPC(sp) # skip syscall on return

‎arch/mips/kernel/smtc-asm.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ FEXPORT(__smtc_ipi_vector)
9696
/* Save all will redundantly recompute the SP, but use it for now */
9797
SAVE_ALL
9898
CLI
99+
TRACE_IRQS_OFF
99100
move a0,sp
100101
/* Function to be invoked passed stack pad slot 5 */
101102
lw t0,PT_PADSLOT5(sp)

0 commit comments

Comments
 (0)