diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/entry.S | 3 | ||||
-rw-r--r-- | arch/sh/kernel/dwarf.c | 20 | ||||
-rw-r--r-- | arch/sh/kernel/entry-common.S | 8 |
3 files changed, 29 insertions, 2 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 3f7e2a22c7c2..f6a389c996cb 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -132,7 +132,6 @@ ENTRY(tlb_protection_violation_store) | |||
132 | mov #1, r5 | 132 | mov #1, r5 |
133 | 133 | ||
134 | call_handle_tlbmiss: | 134 | call_handle_tlbmiss: |
135 | setup_frame_reg | ||
136 | mov.l 1f, r0 | 135 | mov.l 1f, r0 |
137 | mov r5, r8 | 136 | mov r5, r8 |
138 | mov.l @r0, r6 | 137 | mov.l @r0, r6 |
@@ -365,6 +364,8 @@ handle_exception: | |||
365 | mov.l @k2, k2 ! read out vector and keep in k2 | 364 | mov.l @k2, k2 ! read out vector and keep in k2 |
366 | 365 | ||
367 | handle_exception_special: | 366 | handle_exception_special: |
367 | setup_frame_reg | ||
368 | |||
368 | ! Setup return address and jump to exception handler | 369 | ! Setup return address and jump to exception handler |
369 | mov.l 7f, r9 ! fetch return address | 370 | mov.l 7f, r9 ! fetch return address |
370 | stc r2_bank, r0 ! k2 (vector) | 371 | stc r2_bank, r0 ! k2 (vector) |
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index 88d28ec3780a..e51168064e56 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c | |||
@@ -540,6 +540,8 @@ void dwarf_free_frame(struct dwarf_frame *frame) | |||
540 | mempool_free(frame, dwarf_frame_pool); | 540 | mempool_free(frame, dwarf_frame_pool); |
541 | } | 541 | } |
542 | 542 | ||
543 | extern void ret_from_irq(void); | ||
544 | |||
543 | /** | 545 | /** |
544 | * dwarf_unwind_stack - unwind the stack | 546 | * dwarf_unwind_stack - unwind the stack |
545 | * | 547 | * |
@@ -678,6 +680,24 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc, | |||
678 | addr = frame->cfa + reg->addr; | 680 | addr = frame->cfa + reg->addr; |
679 | frame->return_addr = __raw_readl(addr); | 681 | frame->return_addr = __raw_readl(addr); |
680 | 682 | ||
683 | /* | ||
684 | * Ah, the joys of unwinding through interrupts. | ||
685 | * | ||
686 | * Interrupts are tricky - the DWARF info needs to be _really_ | ||
687 | * accurate and unfortunately I'm seeing a lot of bogus DWARF | ||
688 | * info. For example, I've seen interrupts occur in epilogues | ||
689 | * just after the frame pointer (r14) had been restored. The | ||
690 | * problem was that the DWARF info claimed that the CFA could be | ||
691 | * reached by using the value of the frame pointer before it was | ||
692 | * restored. | ||
693 | * | ||
694 | * So until the compiler can be trusted to produce reliable | ||
695 | * DWARF info when it really matters, let's stop unwinding once | ||
696 | * we've calculated the function that was interrupted. | ||
697 | */ | ||
698 | if (prev && prev->pc == (unsigned long)ret_from_irq) | ||
699 | frame->return_addr = 0; | ||
700 | |||
681 | return frame; | 701 | return frame; |
682 | 702 | ||
683 | bail: | 703 | bail: |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index f0abd58c3a69..2b15ae60c3a0 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -70,8 +70,14 @@ ret_from_exception: | |||
70 | CFI_STARTPROC simple | 70 | CFI_STARTPROC simple |
71 | CFI_DEF_CFA r14, 0 | 71 | CFI_DEF_CFA r14, 0 |
72 | CFI_REL_OFFSET 17, 64 | 72 | CFI_REL_OFFSET 17, 64 |
73 | CFI_REL_OFFSET 15, 0 | 73 | CFI_REL_OFFSET 15, 60 |
74 | CFI_REL_OFFSET 14, 56 | 74 | CFI_REL_OFFSET 14, 56 |
75 | CFI_REL_OFFSET 13, 52 | ||
76 | CFI_REL_OFFSET 12, 48 | ||
77 | CFI_REL_OFFSET 11, 44 | ||
78 | CFI_REL_OFFSET 10, 40 | ||
79 | CFI_REL_OFFSET 9, 36 | ||
80 | CFI_REL_OFFSET 8, 32 | ||
75 | preempt_stop() | 81 | preempt_stop() |
76 | ENTRY(ret_from_irq) | 82 | ENTRY(ret_from_irq) |
77 | ! | 83 | ! |