]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - arch/x86/include/asm/ptrace.h
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[can-eth-gw-linux.git] / arch / x86 / include / asm / ptrace.h
index 19f16ebaf4fa826216c7858d224365b2fdb74670..54d80fddb7398495cf5723398d4b45ce49ac7719 100644 (file)
@@ -239,6 +239,15 @@ static inline unsigned long regs_get_register(struct pt_regs *regs,
 {
        if (unlikely(offset > MAX_REG_OFFSET))
                return 0;
+#ifdef CONFIG_X86_32
+       /*
+        * Traps from the kernel do not save sp and ss.
+        * Use the helper function to retrieve sp.
+        */
+       if (offset == offsetof(struct pt_regs, sp) &&
+           regs->cs == __KERNEL_CS)
+               return kernel_stack_pointer(regs);
+#endif
        return *(unsigned long *)((unsigned long)regs + offset);
 }