aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/avr32/Kconfig6
-rw-r--r--arch/avr32/kernel/entry-avr32b.S54
-rw-r--r--include/asm-avr32/sysreg.h2
3 files changed, 43 insertions, 19 deletions
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 599ec166d833..b77abce10c7a 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -27,6 +27,12 @@ config GENERIC_HARDIRQS
27config STACKTRACE_SUPPORT 27config STACKTRACE_SUPPORT
28 def_bool y 28 def_bool y
29 29
30config LOCKDEP_SUPPORT
31 def_bool y
32
33config TRACE_IRQFLAGS_SUPPORT
34 def_bool y
35
30config HARDIRQS_SW_RESEND 36config HARDIRQS_SW_RESEND
31 def_bool y 37 def_bool y
32 38
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index ccadfd9b438d..cc2a9b76a344 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -527,15 +527,14 @@ fault_exit_work:
527 527
528 /* If we get a debug trap from privileged context we end up here */ 528 /* If we get a debug trap from privileged context we end up here */
529handle_debug_priv: 529handle_debug_priv:
530 /* Fix up LR and SP in regs. r11 contains the mode we came from */ 530 /* Fix up LR and SP in regs. r1 contains the mode we came from */
531 mfsr r8, SYSREG_SR 531 mfsr r2, SYSREG_SR
532 mov r9, r8 532 mov r3, r2
533 andh r8, hi(~MODE_MASK) 533 bfins r2, r1, SYSREG_MODE_OFFSET, SYSREG_MODE_SIZE
534 or r8, r11 534 mtsr SYSREG_SR, r2
535 mtsr SYSREG_SR, r8
536 sub pc, -2 535 sub pc, -2
537 stdsp sp[REG_LR], lr 536 stdsp sp[REG_LR], lr
538 mtsr SYSREG_SR, r9 537 mtsr SYSREG_SR, r3
539 sub pc, -2 538 sub pc, -2
540 sub r10, sp, -FRAME_SIZE_FULL 539 sub r10, sp, -FRAME_SIZE_FULL
541 stdsp sp[REG_SP], r10 540 stdsp sp[REG_SP], r10
@@ -547,15 +546,19 @@ handle_debug_priv:
547 popm r10, r11 546 popm r10, r11
548 mtsr SYSREG_RAR_DBG, r10 547 mtsr SYSREG_RAR_DBG, r10
549 mtsr SYSREG_RSR_DBG, r11 548 mtsr SYSREG_RSR_DBG, r11
550 mfsr r8, SYSREG_SR 549#ifdef CONFIG_TRACE_IRQFLAGS
551 mov r9, r8 550 bld r11, SYSREG_GM_OFFSET
552 andh r8, hi(~MODE_MASK) 551 brcc 1f
553 andh r11, hi(MODE_MASK) 552 rcall trace_hardirqs_on
554 or r8, r11 5531:
555 mtsr SYSREG_SR, r8 554#endif
555 mfsr r2, SYSREG_SR
556 mov r3, r2
557 bfins r2, r1, SYSREG_MODE_OFFSET, SYSREG_MODE_SIZE
558 mtsr SYSREG_SR, r2
556 sub pc, -2 559 sub pc, -2
557 popm lr 560 popm lr
558 mtsr SYSREG_SR, r9 561 mtsr SYSREG_SR, r3
559 sub pc, -2 562 sub pc, -2
560 sub sp, -4 /* skip SP */ 563 sub sp, -4 /* skip SP */
561 popm r0-r12 564 popm r0-r12
@@ -572,11 +575,14 @@ handle_debug_priv:
572handle_debug: 575handle_debug:
573 sub sp, 4 /* r12_orig */ 576 sub sp, 4 /* r12_orig */
574 stmts --sp, r0-lr 577 stmts --sp, r0-lr
575 mfsr r10, SYSREG_RAR_DBG 578 mfsr r0, SYSREG_RAR_DBG
576 mfsr r11, SYSREG_RSR_DBG 579 mfsr r1, SYSREG_RSR_DBG
580#ifdef CONFIG_TRACE_IRQFLAGS
581 rcall trace_hardirqs_off
582#endif
577 unmask_exceptions 583 unmask_exceptions
578 pushm r10,r11 584 stm --sp, r0, r1
579 andh r11, (MODE_MASK >> 16), COH 585 bfextu r1, r1, SYSREG_MODE_OFFSET, SYSREG_MODE_SIZE
580 brne handle_debug_priv 586 brne handle_debug_priv
581 587
582 mov r12, sp 588 mov r12, sp
@@ -591,6 +597,12 @@ debug_restore_all:
591 mask_exceptions 597 mask_exceptions
592 mtsr SYSREG_RSR_DBG, r11 598 mtsr SYSREG_RSR_DBG, r11
593 mtsr SYSREG_RAR_DBG, r10 599 mtsr SYSREG_RAR_DBG, r10
600#ifdef CONFIG_TRACE_IRQFLAGS
601 bld r11, SYSREG_GM_OFFSET
602 brcc 1f
603 rcall trace_hardirqs_on
6041:
605#endif
594 ldmts sp++, r0-lr 606 ldmts sp++, r0-lr
595 sub sp, -4 607 sub sp, -4
596 retd 608 retd
@@ -675,7 +687,11 @@ irq_level\level:
675 andl r1, _TIF_WORK_MASK, COH 687 andl r1, _TIF_WORK_MASK, COH
676 brne irq_exit_work 688 brne irq_exit_work
677 689
6781: popm r8-r9 6901:
691#ifdef CONFIG_TRACE_IRQFLAGS
692 rcall trace_hardirqs_on
693#endif
694 popm r8-r9
679 mtsr rar_int\level, r8 695 mtsr rar_int\level, r8
680 mtsr rsr_int\level, r9 696 mtsr rsr_int\level, r9
681 ldmts sp++,r0-lr 697 ldmts sp++,r0-lr
diff --git a/include/asm-avr32/sysreg.h b/include/asm-avr32/sysreg.h
index dd21182b60e0..d4e0950170ca 100644
--- a/include/asm-avr32/sysreg.h
+++ b/include/asm-avr32/sysreg.h
@@ -93,6 +93,8 @@
93#define SYSREG_I3M_SIZE 1 93#define SYSREG_I3M_SIZE 1
94#define SYSREG_EM_OFFSET 21 94#define SYSREG_EM_OFFSET 21
95#define SYSREG_EM_SIZE 1 95#define SYSREG_EM_SIZE 1
96#define SYSREG_MODE_OFFSET 22
97#define SYSREG_MODE_SIZE 3
96#define SYSREG_M0_OFFSET 22 98#define SYSREG_M0_OFFSET 22
97#define SYSREG_M0_SIZE 1 99#define SYSREG_M0_SIZE 1
98#define SYSREG_M1_OFFSET 23 100#define SYSREG_M1_OFFSET 23