diff options
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r-- | arch/mips/kernel/traps.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index e51d8fd9a152..440b8651fd8b 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <asm/mmu_context.h> | 41 | #include <asm/mmu_context.h> |
42 | #include <asm/watch.h> | 42 | #include <asm/watch.h> |
43 | #include <asm/types.h> | 43 | #include <asm/types.h> |
44 | #include <asm/stacktrace.h> | ||
44 | 45 | ||
45 | extern asmlinkage void handle_int(void); | 46 | extern asmlinkage void handle_int(void); |
46 | extern asmlinkage void handle_tlbm(void); | 47 | extern asmlinkage void handle_tlbm(void); |
@@ -92,16 +93,14 @@ static void show_raw_backtrace(unsigned long reg29) | |||
92 | } | 93 | } |
93 | 94 | ||
94 | #ifdef CONFIG_KALLSYMS | 95 | #ifdef CONFIG_KALLSYMS |
95 | static int raw_show_trace; | 96 | int raw_show_trace; |
96 | static int __init set_raw_show_trace(char *str) | 97 | static int __init set_raw_show_trace(char *str) |
97 | { | 98 | { |
98 | raw_show_trace = 1; | 99 | raw_show_trace = 1; |
99 | return 1; | 100 | return 1; |
100 | } | 101 | } |
101 | __setup("raw_show_trace", set_raw_show_trace); | 102 | __setup("raw_show_trace", set_raw_show_trace); |
102 | 103 | #endif | |
103 | extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, | ||
104 | unsigned long pc, unsigned long ra); | ||
105 | 104 | ||
106 | static void show_backtrace(struct task_struct *task, struct pt_regs *regs) | 105 | static void show_backtrace(struct task_struct *task, struct pt_regs *regs) |
107 | { | 106 | { |
@@ -121,9 +120,6 @@ static void show_backtrace(struct task_struct *task, struct pt_regs *regs) | |||
121 | } while (pc); | 120 | } while (pc); |
122 | printk("\n"); | 121 | printk("\n"); |
123 | } | 122 | } |
124 | #else | ||
125 | #define show_backtrace(task, r) show_raw_backtrace((r)->regs[29]); | ||
126 | #endif | ||
127 | 123 | ||
128 | /* | 124 | /* |
129 | * This routine abuses get_user()/put_user() to reference pointers | 125 | * This routine abuses get_user()/put_user() to reference pointers |
@@ -158,28 +154,6 @@ static void show_stacktrace(struct task_struct *task, struct pt_regs *regs) | |||
158 | show_backtrace(task, regs); | 154 | show_backtrace(task, regs); |
159 | } | 155 | } |
160 | 156 | ||
161 | static __always_inline void prepare_frametrace(struct pt_regs *regs) | ||
162 | { | ||
163 | __asm__ __volatile__( | ||
164 | ".set push\n\t" | ||
165 | ".set noat\n\t" | ||
166 | #ifdef CONFIG_64BIT | ||
167 | "1: dla $1, 1b\n\t" | ||
168 | "sd $1, %0\n\t" | ||
169 | "sd $29, %1\n\t" | ||
170 | "sd $31, %2\n\t" | ||
171 | #else | ||
172 | "1: la $1, 1b\n\t" | ||
173 | "sw $1, %0\n\t" | ||
174 | "sw $29, %1\n\t" | ||
175 | "sw $31, %2\n\t" | ||
176 | #endif | ||
177 | ".set pop\n\t" | ||
178 | : "=m" (regs->cp0_epc), | ||
179 | "=m" (regs->regs[29]), "=m" (regs->regs[31]) | ||
180 | : : "memory"); | ||
181 | } | ||
182 | |||
183 | void show_stack(struct task_struct *task, unsigned long *sp) | 157 | void show_stack(struct task_struct *task, unsigned long *sp) |
184 | { | 158 | { |
185 | struct pt_regs regs; | 159 | struct pt_regs regs; |
@@ -206,11 +180,6 @@ void dump_stack(void) | |||
206 | { | 180 | { |
207 | struct pt_regs regs; | 181 | struct pt_regs regs; |
208 | 182 | ||
209 | /* | ||
210 | * Remove any garbage that may be in regs (specially func | ||
211 | * addresses) to avoid show_raw_backtrace() to report them | ||
212 | */ | ||
213 | memset(®s, 0, sizeof(regs)); | ||
214 | prepare_frametrace(®s); | 183 | prepare_frametrace(®s); |
215 | show_backtrace(current, ®s); | 184 | show_backtrace(current, ®s); |
216 | } | 185 | } |