Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56774
b: refs/heads/master
c: e2e6fe7
h: refs/heads/master
v: v3
  • Loading branch information
Robin Holt authored and Tony Luck committed May 22, 2007
1 parent 1016184 commit cea6b90
Show file tree
Hide file tree
Showing 2 changed files with 15 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: a8c8be08e023cf65f103442d1c71710fad7a0905
refs/heads/master: e2e6fe7bb6e30621ad4e8a3acb1e711815c239bd
21 changes: 14 additions & 7 deletions trunk/arch/ia64/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ int
unw_unwind (struct unw_frame_info *info)
{
unsigned long prev_ip, prev_sp, prev_bsp;
unsigned long ip, pr, num_regs;
unsigned long ip, pr, num_regs, rp_loc, pfs_loc;
STAT(unsigned long start, flags;)
int retval;

Expand All @@ -1870,27 +1870,31 @@ unw_unwind (struct unw_frame_info *info)
prev_sp = info->sp;
prev_bsp = info->bsp;

/* restore the ip */
if (!info->rp_loc) {
/* validate the return IP pointer */
rp_loc = (unsigned long) info->rp_loc;
if ((rp_loc < info->regstk.limit) || (rp_loc > info->regstk.top)) {
/* FIXME: should really be level 0 but it occurs too often. KAO */
UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n",
__FUNCTION__, info->ip);
STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
return -1;
}
/* restore the ip */
ip = info->ip = *info->rp_loc;
if (ip < GATE_ADDR) {
UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __FUNCTION__, ip);
STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
return -1;
}

/* restore the cfm: */
if (!info->pfs_loc) {
/* validate the previous stack frame pointer */
pfs_loc = (unsigned long) info->pfs_loc;
if ((pfs_loc < info->regstk.limit) || (pfs_loc > info->regstk.top)) {
UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__);
STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
return -1;
}
/* restore the cfm: */
info->cfm_loc = info->pfs_loc;

/* restore the bsp: */
Expand Down Expand Up @@ -1992,13 +1996,16 @@ init_frame_info (struct unw_frame_info *info, struct task_struct *t,
memset(info, 0, sizeof(*info));

rbslimit = (unsigned long) t + IA64_RBS_OFFSET;
stklimit = (unsigned long) t + IA64_STK_OFFSET;

rbstop = sw->ar_bspstore;
if (rbstop - (unsigned long) t >= IA64_STK_OFFSET)
if (rbstop > stklimit || rbstop < rbslimit)
rbstop = rbslimit;

stklimit = (unsigned long) t + IA64_STK_OFFSET;
if (stktop <= rbstop)
stktop = rbstop;
if (stktop > stklimit)
stktop = stklimit;

info->regstk.limit = rbslimit;
info->regstk.top = rbstop;
Expand Down

0 comments on commit cea6b90

Please sign in to comment.