]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86: get rid of duplicate code in case of CONFIG_VM86
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 26 May 2012 05:07:39 +0000 (01:07 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Sep 2012 17:57:32 +0000 (13:57 -0400)
no need to have the call of do_notify_resume() + checks around it
duplicated for vm86 case - a bit of rearranging of ifdefs and we'll
have a perfectly fine copy to jump back to.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/x86/kernel/entry_32.S

index c9ae24d2e1e426efb1908670d7f7f5cd56eee07f..8c764c594a3e6b22d22e44ee154872cd4f641afa 100644 (file)
@@ -620,6 +620,10 @@ work_notifysig:                            # deal with pending signals and
        movl %esp, %eax
        jne work_notifysig_v86          # returning to kernel-space or
                                        # vm86-space
+1:
+#else
+       movl %esp, %eax
+#endif
        TRACE_IRQS_ON
        ENABLE_INTERRUPTS(CLBR_NONE)
        movb PT_CS(%esp), %bl
@@ -630,24 +634,15 @@ work_notifysig:                           # deal with pending signals and
        call do_notify_resume
        jmp resume_userspace
 
+#ifdef CONFIG_VM86
        ALIGN
 work_notifysig_v86:
        pushl_cfi %ecx                  # save ti_flags for do_notify_resume
        call save_v86_state             # %eax contains pt_regs pointer
        popl_cfi %ecx
        movl %eax, %esp
-#else
-       movl %esp, %eax
+       jmp 1b
 #endif
-       TRACE_IRQS_ON
-       ENABLE_INTERRUPTS(CLBR_NONE)
-       movb PT_CS(%esp), %bl
-       andb $SEGMENT_RPL_MASK, %bl
-       cmpb $USER_RPL, %bl
-       jb resume_kernel
-       xorl %edx, %edx
-       call do_notify_resume
-       jmp resume_userspace
 END(work_pending)
 
        # perform syscall exit tracing