Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / arch / x86 / kernel / ptrace.c
index ee9099061d0190e93c5ec012fb0aec5259da1e19..8eb1e58de043176759f544ba4425b2e86df5aee4 100644 (file)
@@ -155,35 +155,6 @@ static inline bool invalid_selector(u16 value)
 
 #define FLAG_MASK              FLAG_MASK_32
 
-/*
- * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
- * when it traps.  The previous stack will be directly underneath the saved
- * registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
- *
- * Now, if the stack is empty, '&regs->sp' is out of range. In this
- * case we try to take the previous stack. To always return a non-null
- * stack pointer we fall back to regs as stack if no previous stack
- * exists.
- *
- * This is valid only for kernel mode traps.
- */
-unsigned long kernel_stack_pointer(struct pt_regs *regs)
-{
-       unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1);
-       unsigned long sp = (unsigned long)&regs->sp;
-       u32 *prev_esp;
-
-       if (context == (sp & ~(THREAD_SIZE - 1)))
-               return sp;
-
-       prev_esp = (u32 *)(context);
-       if (*prev_esp)
-               return (unsigned long)*prev_esp;
-
-       return (unsigned long)regs;
-}
-EXPORT_SYMBOL_GPL(kernel_stack_pointer);
-
 static unsigned long *pt_regs_access(struct pt_regs *regs, unsigned long regno)
 {
        BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0);