diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-07-12 19:10:22 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-07-12 19:10:22 -0400 |
commit | f1743f00e6058d2dee44510f3ef165c549a6291e (patch) | |
tree | 00286e777fefe26691e14be0e77536f0c9737214 /runtime/unwind | |
parent | ad125a746537f806424fbad8d36eff332dffc25a (diff) | |
download | systemtap-steved-f1743f00e6058d2dee44510f3ef165c549a6291e.tar.gz systemtap-steved-f1743f00e6058d2dee44510f3ef165c549a6291e.tar.xz systemtap-steved-f1743f00e6058d2dee44510f3ef165c549a6291e.zip |
PR6738: restore support for rhel4-era (2.6.9) kernels
Diffstat (limited to 'runtime/unwind')
-rw-r--r-- | runtime/unwind/i386.h | 9 | ||||
-rw-r--r-- | runtime/unwind/unwind.h | 5 | ||||
-rw-r--r-- | runtime/unwind/x86_64.h | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/runtime/unwind/i386.h b/runtime/unwind/i386.h index 79e6ba73..9f488f07 100644 --- a/runtime/unwind/i386.h +++ b/runtime/unwind/i386.h @@ -68,6 +68,13 @@ struct unwind_frame_info ((raItem).where == Memory && \ !((raItem).value * (dataAlign) + 4)) + +/* 2.6.9-era compatibility */ +#ifndef user_mode_vm +#define user_mode_vm(regs) user_mode(regs) +#endif + + static inline void arch_unw_init_frame_info(struct unwind_frame_info *info, /*const*/ struct pt_regs *regs) { @@ -125,8 +132,10 @@ static inline int arch_unw_user_mode(const struct unwind_frame_info *info) || info->regs.sp < PAGE_OFFSET; #else return info->regs.eip < PAGE_OFFSET +#ifdef FIX_VDSO /* newer kernel? */ || (info->regs.eip >= __fix_to_virt(FIX_VDSO) && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE) +#endif || info->regs.esp < PAGE_OFFSET; #endif #endif diff --git a/runtime/unwind/unwind.h b/runtime/unwind/unwind.h index ae5e75d3..78a4bfef 100644 --- a/runtime/unwind/unwind.h +++ b/runtime/unwind/unwind.h @@ -25,6 +25,11 @@ #define MAX_STACK_DEPTH 8 +#ifndef BUILD_BUG_ON_ZERO +#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) +#endif + + #define EXTRA_INFO(f) { \ BUILD_BUG_ON_ZERO(offsetof(struct unwind_frame_info, f) \ % FIELD_SIZEOF(struct unwind_frame_info, f)) \ diff --git a/runtime/unwind/x86_64.h b/runtime/unwind/x86_64.h index 5eb3a58f..3c70f206 100644 --- a/runtime/unwind/x86_64.h +++ b/runtime/unwind/x86_64.h @@ -137,11 +137,15 @@ static inline int arch_unw_user_mode(const struct unwind_frame_info *info) #else #ifdef STAPCONF_X86_UNIREGS return (long)info->regs.ip >= 0 +#ifdef VSYSCALL_START || (info->regs.ip >= VSYSCALL_START && info->regs.ip < VSYSCALL_END) +#endif || (long)info->regs.sp >= 0; #else return (long)info->regs.rip >= 0 +#ifdef VSYSCALL_START || (info->regs.rip >= VSYSCALL_START && info->regs.rip < VSYSCALL_END) +#endif || (long)info->regs.rsp >= 0; #endif #endif |