diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-27 10:04:02 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-27 10:04:02 -0700 |
commit | b75ae8603568ae18f270213693758c78fb8a29ff (patch) | |
tree | 15e6c100baadcbce6b7f9f00d50de8c2b7da4c01 /arch/ia64/kernel | |
parent | 75ca0d22668a36fc83e17407d369b528a22c562c (diff) | |
parent | 1ee27a4eedf3cc08245d395936c1bfaf80c074cc (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
[IA64] Make SN2 PCI code use ioremap rather than manually mangle the address
[IA64] Force error to surface in nofault code
[IA64] change sh_change_coherence oemcall to use nolock
[IA64] remove duplicate header include line
[IA64] Correct unwind validation code
[IA64] is_power_of_2-ia64/mm/hugetlbpage.c
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/time.c | 1 | ||||
-rw-r--r-- | arch/ia64/kernel/unwind.c | 16 |
2 files changed, 11 insertions, 6 deletions
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index a06667c7acc0..3486fe7d6e65 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -18,7 +18,6 @@ #include <linux/time.h> #include <linux/interrupt.h> #include <linux/efi.h> -#include <linux/profile.h> #include <linux/timex.h> #include <asm/machvec.h> diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c index b0b08b5f3eca..c1bdb5131814 100644 --- a/arch/ia64/kernel/unwind.c +++ b/arch/ia64/kernel/unwind.c @@ -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; @@ -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); @@ -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; |