]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/i386/kernel/time.c
[PATCH] i386: Profile pc badness
[net-next-2.6.git] / arch / i386 / kernel / time.c
index 9603ccaba997fd7284ee670b7362c28f47c5a6f6..a4f67a6e6821ebd816c5ed567525616483d3e620 100644 (file)
@@ -131,15 +131,13 @@ unsigned long profile_pc(struct pt_regs *regs)
        unsigned long pc = instruction_pointer(regs);
 
 #ifdef CONFIG_SMP
-       if (!user_mode_vm(regs) && in_lock_functions(pc)) {
+       if (!v8086_mode(regs) && SEGMENT_IS_KERNEL_CODE(regs->xcs) &&
+           in_lock_functions(pc)) {
 #ifdef CONFIG_FRAME_POINTER
                return *(unsigned long *)(regs->ebp + 4);
 #else
-               unsigned long *sp;
-               if ((regs->xcs & 3) == 0)
-                       sp = (unsigned long *)&regs->esp;
-               else
-                       sp = (unsigned long *)regs->esp;
+               unsigned long *sp = (unsigned long *)&regs->esp;
+
                /* Return address is either directly at stack pointer
                   or above a saved eflags. Eflags has bits 22-31 zero,
                   kernel addresses don't. */