Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145101
b: refs/heads/master
c: 7b6c6c7
h: refs/heads/master
i:
  145099: 122c4b2
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed May 11, 2009
1 parent af87dd4 commit beddd80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 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: 3c598766a2bae1b208470e7cc934ac462561e3cb
refs/heads/master: 7b6c6c77732ca1d2498eda7eabb64f9648896e96
7 changes: 4 additions & 3 deletions trunk/arch/x86/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,15 @@ static inline int v8086_mode(struct pt_regs *regs)

/*
* X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
* when it traps. So regs will be the current sp.
* when it traps. The previous stack will be directly underneath the saved
* registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
*
* This is valid only for kernel mode traps.
*/
static inline unsigned long kernel_trap_sp(struct pt_regs *regs)
static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
{
#ifdef CONFIG_X86_32
return (unsigned long)regs;
return (unsigned long)(&regs->sp);
#else
return regs->sp;
#endif
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/oprofile/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ void
x86_backtrace(struct pt_regs * const regs, unsigned int depth)
{
struct frame_head *head = (struct frame_head *)frame_pointer(regs);
unsigned long stack = kernel_trap_sp(regs);

if (!user_mode_vm(regs)) {
unsigned long stack = kernel_stack_pointer(regs);
if (depth)
dump_trace(NULL, regs, (unsigned long *)stack, 0,
&backtrace_ops, &depth);
Expand Down

0 comments on commit beddd80

Please sign in to comment.