aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-01-30 07:33:16 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:16 -0500
commitf6e8e28410c017adb273983057023a17a8791ad3 (patch)
tree35dbd728a9838158d74947112b09c2530e331aeb
parentdbe3533b7f687402651e893d5b3a7b66f22d6487 (diff)
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 <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/oprofile/backtrace.c2
-rw-r--r--include/asm-x86/ptrace.h8
2 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
index 0ca4815a2938..e2095cba409f 100644
--- a/arch/x86/oprofile/backtrace.c
+++ b/arch/x86/oprofile/backtrace.c
@@ -77,7 +77,7 @@ void
77x86_backtrace(struct pt_regs * const regs, unsigned int depth) 77x86_backtrace(struct pt_regs * const regs, unsigned int depth)
78{ 78{
79 struct frame_head *head = (struct frame_head *)frame_pointer(regs); 79 struct frame_head *head = (struct frame_head *)frame_pointer(regs);
80 unsigned long stack = stack_pointer(regs); 80 unsigned long stack = kernel_trap_sp(regs);
81 81
82 if (!user_mode_vm(regs)) { 82 if (!user_mode_vm(regs)) {
83 if (depth) 83 if (depth)
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)
182#endif 182#endif
183} 183}
184 184
185static inline unsigned long stack_pointer(struct pt_regs *regs) 185/*
186 * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
187 * when it traps. So regs will be the current sp.
188 *
189 * This is valid only for kernel mode traps.
190 */
191static inline unsigned long kernel_trap_sp(struct pt_regs *regs)
186{ 192{
187#ifdef CONFIG_X86_32 193#ifdef CONFIG_X86_32
188 return (unsigned long)regs; 194 return (unsigned long)regs;