Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
[sfrench/cifs-2.6.git] / arch / x86 / ia32 / ia32entry.S
index 0db0a6291bbd06d059c654ce58f8e5d387d685c0..ae7158bce4d62d6b0ec1bfec5c52ead3b3e48049 100644 (file)
@@ -162,12 +162,14 @@ sysenter_tracesys:
        SAVE_REST
        CLEAR_RREGS
        movq    %r9,R9(%rsp)
-       movq    $-ENOSYS,RAX(%rsp)      /* really needed? */
+       movq    $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
        movq    %rsp,%rdi        /* &pt_regs -> arg1 */
        call    syscall_trace_enter
        LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
        xchgl   %ebp,%r9d
+       cmpl    $(IA32_NR_syscalls-1),%eax
+       ja      int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
        jmp     sysenter_do_call
        CFI_ENDPROC
 ENDPROC(ia32_sysenter_target)
@@ -261,13 +263,15 @@ cstar_tracesys:
        SAVE_REST
        CLEAR_RREGS
        movq %r9,R9(%rsp)
-       movq $-ENOSYS,RAX(%rsp) /* really needed? */
+       movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
        movq %rsp,%rdi        /* &pt_regs -> arg1 */
        call syscall_trace_enter
        LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
        xchgl %ebp,%r9d
        movl RSP-ARGOFFSET(%rsp), %r8d
+       cmpl $(IA32_NR_syscalls-1),%eax
+       ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
        jmp cstar_do_call
 END(ia32_cstar_target)
                                
@@ -325,7 +329,7 @@ ENTRY(ia32_syscall)
        jnz ia32_tracesys
 ia32_do_syscall:       
        cmpl $(IA32_NR_syscalls-1),%eax
-       ja  ia32_badsys
+       ja  int_ret_from_sys_call       /* ia32_tracesys has set RAX(%rsp) */
        IA32_ARG_FIXUP
        call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
 ia32_sysret:
@@ -335,7 +339,7 @@ ia32_sysret:
 ia32_tracesys:                  
        SAVE_REST
        CLEAR_RREGS
-       movq $-ENOSYS,RAX(%rsp) /* really needed? */
+       movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
        movq %rsp,%rdi        /* &pt_regs -> arg1 */
        call syscall_trace_enter
        LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
@@ -722,7 +726,9 @@ ia32_sys_call_table:
        .quad sys_epoll_pwait
        .quad compat_sys_utimensat      /* 320 */
        .quad compat_sys_signalfd
-       .quad compat_sys_timerfd
+       .quad sys_timerfd_create
        .quad sys_eventfd
        .quad sys32_fallocate
+       .quad compat_sys_timerfd_settime        /* 325 */
+       .quad compat_sys_timerfd_gettime
 ia32_syscall_end: