From f6e8e28410c017adb273983057023a17a8791ad3 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Wed, 30 Jan 2008 13:33:16 +0100 Subject: x86: rename stack_pointer to kernel_trap_sp Choose a less generic name for such a special case. Add a comment explaining the odd use in X86_32. Change the one user of stack_pointer. Signed-off-by: Harvey Harrison Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/ptrace.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/asm-x86/ptrace.h') diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h index 79d5b8fcd7b1..d9e04b46a440 100644 --- a/include/asm-x86/ptrace.h +++ b/include/asm-x86/ptrace.h @@ -182,7 +182,13 @@ static inline int v8086_mode(struct pt_regs *regs) #endif } -static inline unsigned long stack_pointer(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. + * + * This is valid only for kernel mode traps. + */ +static inline unsigned long kernel_trap_sp(struct pt_regs *regs) { #ifdef CONFIG_X86_32 return (unsigned long)regs; -- cgit v1.2.3