Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58070
b: refs/heads/master
c: 66fa9b1
h: refs/heads/master
v: v3
  • Loading branch information
Keith Owens authored and Tony Luck committed Jun 26, 2007
1 parent 614a005 commit 6123069
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: 9be26f4c4b138c425598bd3cc50411bd87fce287
refs/heads/master: 66fa9b107e259d01929fe647796b3021d3a83c4a
16 changes: 11 additions & 5 deletions trunk/arch/ia64/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,11 +1856,19 @@ find_save_locs (struct unw_frame_info *info)
return 0;
}

static int
unw_valid(const struct unw_frame_info *info, unsigned long* p)
{
unsigned long loc = (unsigned long)p;
return (loc >= info->regstk.limit && loc < info->regstk.top) ||
(loc >= info->memstk.top && loc < info->memstk.limit);
}

int
unw_unwind (struct unw_frame_info *info)
{
unsigned long prev_ip, prev_sp, prev_bsp;
unsigned long ip, pr, num_regs, rp_loc, pfs_loc;
unsigned long ip, pr, num_regs;
STAT(unsigned long start, flags;)
int retval;

Expand All @@ -1871,8 +1879,7 @@ unw_unwind (struct unw_frame_info *info)
prev_bsp = info->bsp;

/* validate the return IP pointer */
rp_loc = (unsigned long) info->rp_loc;
if ((rp_loc < info->regstk.limit) || (rp_loc > info->regstk.top)) {
if (!unw_valid(info, info->rp_loc)) {
/* 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);
Expand All @@ -1888,8 +1895,7 @@ unw_unwind (struct unw_frame_info *info)
}

/* validate the previous stack frame pointer */
pfs_loc = (unsigned long) info->pfs_loc;
if ((pfs_loc < info->regstk.limit) || (pfs_loc > info->regstk.top)) {
if (!unw_valid(info, info->pfs_loc)) {
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;
Expand Down

0 comments on commit 6123069

Please sign in to comment.