diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-21 18:57:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-21 18:57:50 -0400 |
commit | 9738cbe32192919356397f1e24f9b26e1f574fbb (patch) | |
tree | 75caa6d21a8b68a36285ee787095fb05b14627fb /arch | |
parent | 58229a18994215bbfe0bcd1c99d2e039f30b076b (diff) | |
parent | 05dc16d6a175139a5872d08db56ee277ec90df5b (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
[PARISC] unwinder improvements
[PARISC] Fix unwinder on 64-bit kernels
[PARISC] Handle wrapping in expand_upwards()
[PARISC] stop lcd driver from stripping initial whitespace
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/unwind.c | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index e70f57e27643..322167737de7 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c | |||
@@ -16,6 +16,8 @@ | |||
16 | 16 | ||
17 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
18 | #include <asm/assembly.h> | 18 | #include <asm/assembly.h> |
19 | #include <asm/asm-offsets.h> | ||
20 | #include <asm/ptrace.h> | ||
19 | 21 | ||
20 | #include <asm/unwind.h> | 22 | #include <asm/unwind.h> |
21 | 23 | ||
@@ -26,6 +28,8 @@ | |||
26 | #define dbg(x...) | 28 | #define dbg(x...) |
27 | #endif | 29 | #endif |
28 | 30 | ||
31 | #define KERNEL_START (KERNEL_BINARY_TEXT_START - 0x1000) | ||
32 | |||
29 | extern struct unwind_table_entry __start___unwind[]; | 33 | extern struct unwind_table_entry __start___unwind[]; |
30 | extern struct unwind_table_entry __stop___unwind[]; | 34 | extern struct unwind_table_entry __stop___unwind[]; |
31 | 35 | ||
@@ -197,6 +201,29 @@ static int unwind_init(void) | |||
197 | return 0; | 201 | return 0; |
198 | } | 202 | } |
199 | 203 | ||
204 | #ifdef CONFIG_64BIT | ||
205 | #define get_func_addr(fptr) fptr[2] | ||
206 | #else | ||
207 | #define get_func_addr(fptr) fptr[0] | ||
208 | #endif | ||
209 | |||
210 | static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size) | ||
211 | { | ||
212 | void handle_interruption(int, struct pt_regs *); | ||
213 | static unsigned long *hi = (unsigned long)&handle_interruption; | ||
214 | |||
215 | if (pc == get_func_addr(hi)) { | ||
216 | struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN); | ||
217 | dbg("Unwinding through handle_interruption()\n"); | ||
218 | info->prev_sp = regs->gr[30]; | ||
219 | info->prev_ip = regs->iaoq[0]; | ||
220 | |||
221 | return 1; | ||
222 | } | ||
223 | |||
224 | return 0; | ||
225 | } | ||
226 | |||
200 | static void unwind_frame_regs(struct unwind_frame_info *info) | 227 | static void unwind_frame_regs(struct unwind_frame_info *info) |
201 | { | 228 | { |
202 | const struct unwind_table_entry *e; | 229 | const struct unwind_table_entry *e; |
@@ -310,13 +337,15 @@ static void unwind_frame_regs(struct unwind_frame_info *info) | |||
310 | } | 337 | } |
311 | } | 338 | } |
312 | 339 | ||
313 | info->prev_sp = info->sp - frame_size; | 340 | if (!unwind_special(info, e->region_start, frame_size)) { |
314 | if (e->Millicode) | 341 | info->prev_sp = info->sp - frame_size; |
315 | info->rp = info->r31; | 342 | if (e->Millicode) |
316 | else if (rpoffset) | 343 | info->rp = info->r31; |
317 | info->rp = *(unsigned long *)(info->prev_sp - rpoffset); | 344 | else if (rpoffset) |
318 | info->prev_ip = info->rp; | 345 | info->rp = *(unsigned long *)(info->prev_sp - rpoffset); |
319 | info->rp = 0; | 346 | info->prev_ip = info->rp; |
347 | info->rp = 0; | ||
348 | } | ||
320 | 349 | ||
321 | dbg("analyzing func @ %lx, setting prev_sp=%lx " | 350 | dbg("analyzing func @ %lx, setting prev_sp=%lx " |
322 | "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, | 351 | "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, |