diff options
-rw-r--r-- | arch/sh/include/asm/entry-macros.S | 12 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/entry.S | 1 | ||||
-rw-r--r-- | arch/sh/kernel/entry-common.S | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/arch/sh/include/asm/entry-macros.S b/arch/sh/include/asm/entry-macros.S index 1bdd93891cd7..64fd0de24daf 100644 --- a/arch/sh/include/asm/entry-macros.S +++ b/arch/sh/include/asm/entry-macros.S | |||
@@ -108,3 +108,15 @@ | |||
108 | #else | 108 | #else |
109 | # define PREF(x) nop | 109 | # define PREF(x) nop |
110 | #endif | 110 | #endif |
111 | |||
112 | /* | ||
113 | * Macro for use within assembly. Because the DWARF unwinder | ||
114 | * needs to use the frame register to unwind the stack, we | ||
115 | * need to setup r14 with the value of the stack pointer as | ||
116 | * the return address is usually on the stack somewhere. | ||
117 | */ | ||
118 | .macro setup_frame_reg | ||
119 | #ifdef CONFIG_DWARF_UNWINDER | ||
120 | mov r15, r14 | ||
121 | #endif | ||
122 | .endm | ||
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 3cb531f233f2..67ad6467c694 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -137,6 +137,7 @@ ENTRY(tlb_protection_violation_store) | |||
137 | mov #1, r5 | 137 | mov #1, r5 |
138 | 138 | ||
139 | call_dpf: | 139 | call_dpf: |
140 | setup_frame_reg | ||
140 | mov.l 1f, r0 | 141 | mov.l 1f, r0 |
141 | mov r5, r8 | 142 | mov r5, r8 |
142 | mov.l @r0, r6 | 143 | mov.l @r0, r6 |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index fc26ccd82789..b3b215fb21f7 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -285,6 +285,7 @@ ret_from_fork: | |||
285 | * system calls and debug traps through their respective jump tables. | 285 | * system calls and debug traps through their respective jump tables. |
286 | */ | 286 | */ |
287 | ENTRY(system_call) | 287 | ENTRY(system_call) |
288 | setup_frame_reg | ||
288 | #if !defined(CONFIG_CPU_SH2) | 289 | #if !defined(CONFIG_CPU_SH2) |
289 | mov.l 1f, r9 | 290 | mov.l 1f, r9 |
290 | mov.l @r9, r8 ! Read from TRA (Trap Address) Register | 291 | mov.l @r9, r8 ! Read from TRA (Trap Address) Register |