diff options
Diffstat (limited to 'arch/xtensa/kernel/entry.S')
-rw-r--r-- | arch/xtensa/kernel/entry.S | 32 |
1 files changed, 32 insertions, 0 deletions
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 |