Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57942
b: refs/heads/master
c: 05dc16d
h: refs/heads/master
v: v3
  • Loading branch information
Randolph Chung authored and Kyle McMartin committed Jun 21, 2007
1 parent 54361a2 commit 2ca3d0c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e036306aa1832963cd147849b282259a32f5ac08
refs/heads/master: 05dc16d6a175139a5872d08db56ee277ec90df5b
41 changes: 34 additions & 7 deletions trunk/arch/parisc/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <asm/uaccess.h>
#include <asm/assembly.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>

#include <asm/unwind.h>

Expand Down Expand Up @@ -199,6 +201,29 @@ static int unwind_init(void)
return 0;
}

#ifdef CONFIG_64BIT
#define get_func_addr(fptr) fptr[2]
#else
#define get_func_addr(fptr) fptr[0]
#endif

static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size)
{
void handle_interruption(int, struct pt_regs *);
static unsigned long *hi = (unsigned long)&handle_interruption;

if (pc == get_func_addr(hi)) {
struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN);
dbg("Unwinding through handle_interruption()\n");
info->prev_sp = regs->gr[30];
info->prev_ip = regs->iaoq[0];

return 1;
}

return 0;
}

static void unwind_frame_regs(struct unwind_frame_info *info)
{
const struct unwind_table_entry *e;
Expand Down Expand Up @@ -312,13 +337,15 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
}
}

info->prev_sp = info->sp - frame_size;
if (e->Millicode)
info->rp = info->r31;
else if (rpoffset)
info->rp = *(unsigned long *)(info->prev_sp - rpoffset);
info->prev_ip = info->rp;
info->rp = 0;
if (!unwind_special(info, e->region_start, frame_size)) {
info->prev_sp = info->sp - frame_size;
if (e->Millicode)
info->rp = info->r31;
else if (rpoffset)
info->rp = *(unsigned long *)(info->prev_sp - rpoffset);
info->prev_ip = info->rp;
info->rp = 0;
}

dbg("analyzing func @ %lx, setting prev_sp=%lx "
"prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp,
Expand Down

0 comments on commit 2ca3d0c

Please sign in to comment.