diff options
Diffstat (limited to 'arch/x86/include/asm/ptrace.h')
-rw-r--r-- | arch/x86/include/asm/ptrace.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index e304b66abeea..624f133943ed 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h | |||
@@ -187,14 +187,15 @@ static inline int v8086_mode(struct pt_regs *regs) | |||
187 | 187 | ||
188 | /* | 188 | /* |
189 | * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode | 189 | * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode |
190 | * when it traps. So regs will be the current sp. | 190 | * when it traps. The previous stack will be directly underneath the saved |
191 | * registers, and 'sp/ss' won't even have been saved. Thus the '®s->sp'. | ||
191 | * | 192 | * |
192 | * This is valid only for kernel mode traps. | 193 | * This is valid only for kernel mode traps. |
193 | */ | 194 | */ |
194 | static inline unsigned long kernel_trap_sp(struct pt_regs *regs) | 195 | static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) |
195 | { | 196 | { |
196 | #ifdef CONFIG_X86_32 | 197 | #ifdef CONFIG_X86_32 |
197 | return (unsigned long)regs; | 198 | return (unsigned long)(®s->sp); |
198 | #else | 199 | #else |
199 | return regs->sp; | 200 | return regs->sp; |
200 | #endif | 201 | #endif |