diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-11-26 08:34:57 -0500 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-12-07 08:52:37 -0500 |
commit | 320516b78bf197fbf7a38ddab09e9dab75741bae (patch) | |
tree | ceccf2c69890c51beaeffeb8162f190e000166da /arch/avr32/kernel/entry-avr32b.S | |
parent | 2f0260371f428fd78ffc2287a5c5768ea8eeab97 (diff) |
[AVR32] Implement irqflags trace and lockdep support
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/kernel/entry-avr32b.S')
-rw-r--r-- | arch/avr32/kernel/entry-avr32b.S | 54 |
1 files changed, 35 insertions, 19 deletions
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 */ |
529 | handle_debug_priv: | 529 | handle_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 | 553 | 1: |
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: | |||
572 | handle_debug: | 575 | handle_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 | ||
604 | 1: | ||
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 | ||
678 | 1: popm r8-r9 | 690 | 1: |
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 |