提交 f6e8e284 编写于 作者: H Harvey Harrison 提交者: Ingo Molnar

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: NHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 dbe3533b
...@@ -77,7 +77,7 @@ void ...@@ -77,7 +77,7 @@ void
x86_backtrace(struct pt_regs * const regs, unsigned int depth) x86_backtrace(struct pt_regs * const regs, unsigned int depth)
{ {
struct frame_head *head = (struct frame_head *)frame_pointer(regs); struct frame_head *head = (struct frame_head *)frame_pointer(regs);
unsigned long stack = stack_pointer(regs); unsigned long stack = kernel_trap_sp(regs);
if (!user_mode_vm(regs)) { if (!user_mode_vm(regs)) {
if (depth) if (depth)
......
...@@ -182,7 +182,13 @@ static inline int v8086_mode(struct pt_regs *regs) ...@@ -182,7 +182,13 @@ static inline int v8086_mode(struct pt_regs *regs)
#endif #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 #ifdef CONFIG_X86_32
return (unsigned long)regs; return (unsigned long)regs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册