diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2013-03-30 22:32:42 -0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2013-05-09 04:07:11 -0400 |
commit | c92931b200156e304350e3e9f138e6abfb1f2913 (patch) | |
tree | 0971196e9bd01c1aecc55753e28cdb80f1cda95b /arch/xtensa | |
parent | 3ae908c99e944a7a5c4f4b2d8c603a6bc57b728b (diff) |
xtensa: add irq flags trace support
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/Kconfig | 3 | ||||
-rw-r--r-- | arch/xtensa/kernel/entry.S | 32 |
2 files changed, 35 insertions, 0 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 13280f2780c8..3eb543eacaa0 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -55,6 +55,9 @@ source "kernel/Kconfig.freezer" | |||
55 | config STACKTRACE_SUPPORT | 55 | config STACKTRACE_SUPPORT |
56 | def_bool y | 56 | def_bool y |
57 | 57 | ||
58 | config TRACE_IRQFLAGS_SUPPORT | ||
59 | def_bool y | ||
60 | |||
58 | config MMU | 61 | config MMU |
59 | def_bool n | 62 | def_bool n |
60 | 63 | ||
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 63845f950792..3729b48d798d 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
@@ -389,6 +389,22 @@ common_exception: | |||
389 | 389 | ||
390 | save_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT | 390 | save_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT |
391 | 391 | ||
392 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
393 | l32i a4, a1, PT_DEPC | ||
394 | /* Double exception means we came here with an exception | ||
395 | * while PS.EXCM was set, i.e. interrupts disabled. | ||
396 | */ | ||
397 | bgeui a4, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f | ||
398 | l32i a4, a1, PT_EXCCAUSE | ||
399 | bnei a4, EXCCAUSE_LEVEL1_INTERRUPT, 1f | ||
400 | /* We came here with an interrupt means interrupts were enabled | ||
401 | * and we've just disabled them. | ||
402 | */ | ||
403 | movi a4, trace_hardirqs_off | ||
404 | callx4 a4 | ||
405 | 1: | ||
406 | #endif | ||
407 | |||
392 | /* Go to second-level dispatcher. Set up parameters to pass to the | 408 | /* Go to second-level dispatcher. Set up parameters to pass to the |
393 | * exception handler and call the exception handler. | 409 | * exception handler and call the exception handler. |
394 | */ | 410 | */ |
@@ -407,6 +423,22 @@ common_exception: | |||
407 | .global common_exception_return | 423 | .global common_exception_return |
408 | common_exception_return: | 424 | common_exception_return: |
409 | 425 | ||
426 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
427 | l32i a4, a1, PT_DEPC | ||
428 | /* Double exception means we came here with an exception | ||
429 | * while PS.EXCM was set, i.e. interrupts disabled. | ||
430 | */ | ||
431 | bgeui a4, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f | ||
432 | l32i a4, a1, PT_EXCCAUSE | ||
433 | bnei a4, EXCCAUSE_LEVEL1_INTERRUPT, 1f | ||
434 | /* We came here with an interrupt means interrupts were enabled | ||
435 | * and we'll reenable them on return. | ||
436 | */ | ||
437 | movi a4, trace_hardirqs_on | ||
438 | callx4 a4 | ||
439 | 1: | ||
440 | #endif | ||
441 | |||
410 | /* Jump if we are returning from kernel exceptions. */ | 442 | /* Jump if we are returning from kernel exceptions. */ |
411 | 443 | ||
412 | 1: l32i a3, a1, PT_PS | 444 | 1: l32i a3, a1, PT_PS |