aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/ptrace.h')
-rw-r--r--arch/x86/include/asm/ptrace.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index e304b66abee..624f133943e 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 '&regs->sp'.
191 * 192 *
192 * This is valid only for kernel mode traps. 193 * This is valid only for kernel mode traps.
193 */ 194 */
194static inline unsigned long kernel_trap_sp(struct pt_regs *regs) 195static 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)(&regs->sp);
198#else 199#else
199 return regs->sp; 200 return regs->sp;
200#endif 201#endif