vserver 1.9.3
[linux-2.6.git] / arch / i386 / kernel / entry.S
index 6387a7e..1c230a7 100644 (file)
@@ -255,11 +255,11 @@ sysenter_past_esp:
        pushl %eax
        SAVE_ALL
        GET_THREAD_INFO(%ebp)
-       cmpl $(nr_syscalls), %eax
-       jae syscall_badsys
 
        testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
        jnz syscall_trace_entry
+       cmpl $(nr_syscalls), %eax
+       jae syscall_badsys
        call *sys_call_table(,%eax,4)
        movl %eax,EAX(%esp)
        cli
@@ -278,11 +278,11 @@ ENTRY(system_call)
        pushl %eax                      # save orig_eax
        SAVE_ALL
        GET_THREAD_INFO(%ebp)
-       cmpl $(nr_syscalls), %eax
-       jae syscall_badsys
                                        # system call tracing in operation
        testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
        jnz syscall_trace_entry
+       cmpl $(nr_syscalls), %eax
+       jae syscall_badsys
 syscall_call:
        call *sys_call_table(,%eax,4)
        movl %eax,EAX(%esp)             # store the return value
@@ -348,7 +348,7 @@ syscall_trace_entry:
        # perform syscall exit tracing
        ALIGN
 syscall_exit_work:
-       testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT), %cl
+       testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl
        jz work_pending
        sti                             # could let do_syscall_trace() call
                                        # schedule() instead
@@ -489,9 +489,16 @@ ENTRY(debug)
        jne debug_stack_correct
        FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn)
 debug_stack_correct:
-       pushl $0
-       pushl $do_debug
-       jmp error_code
+       pushl $-1                       # mark this as an int
+       SAVE_ALL
+       movl %esp,%edx
+       pushl $0
+       pushl %edx
+       call do_debug
+       addl $8,%esp
+       testl %eax,%eax
+       jnz restore_all
+       jmp ret_from_exception
 
 /*
  * NMI is doubly nasty. It can happen _while_ we're handling
@@ -540,9 +547,16 @@ nmi_debug_stack_fixup:
        jmp nmi_stack_correct
 
 ENTRY(int3)
+       pushl $-1                       # mark this as an int
+       SAVE_ALL
+       movl %esp,%edx
        pushl $0
-       pushl $do_int3
-       jmp error_code
+       pushl %edx
+       call do_int3
+       addl $8,%esp
+       testl %eax,%eax
+       jnz restore_all
+       jmp ret_from_exception
 
 ENTRY(overflow)
        pushl $0
@@ -886,5 +900,6 @@ ENTRY(sys_call_table)
        .long sys_mq_notify
        .long sys_mq_getsetattr
        .long sys_ni_syscall            /* reserved for kexec */
+       .long sys_waitid
 
 syscall_table_size=(.-sys_call_table)