Handle options that are integers (e.g. HZ) or strings properly.
[linux-2.6.git] / arch / mips / kernel / scall64-64.S
index d0e60b8..7696b07 100644 (file)
@@ -7,14 +7,14 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
+#include <asm/irqflags.h>
 #include <asm/mipsregs.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/sysmips.h>
 #include <asm/thread_info.h>
 #include <asm/unistd.h>
@@ -34,6 +34,7 @@ NESTED(handle_sys64, PT_SIZE, sp)
         */
        .set    noat
        SAVE_SOME
+       TRACE_IRQS_ON
        STI
        .set    at
 #endif
@@ -53,8 +54,10 @@ NESTED(handle_sys64, PT_SIZE, sp)
 
        sd      a3, PT_R26(sp)          # save a3 for syscall restarting
 
-       LONG_L  t0, TI_FLAGS($28)
-       bltz    t0, syscall_trace_entry # syscall tracing enabled?
+       li      t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
+       LONG_L  t0, TI_FLAGS($28)       # syscall tracing enabled?
+       and     t0, t1, t0
+       bnez    t0, syscall_trace_entry
 
        jalr    t2                      # Do The Real Thing (TM)
 
@@ -91,13 +94,15 @@ syscall_trace_entry:
        li      a1, 0
        jal     do_syscall_trace
 
+       move    t0, s0
+       RESTORE_STATIC
        ld      a0, PT_R4(sp)           # Restore argument registers
        ld      a1, PT_R5(sp)
        ld      a2, PT_R6(sp)
        ld      a3, PT_R7(sp)
        ld      a4, PT_R8(sp)
        ld      a5, PT_R9(sp)
-       jalr    s0
+       jalr    t0
 
        li      t0, -EMAXERRNO - 1      # error?
        sltu    t0, t0, v0
@@ -112,7 +117,7 @@ syscall_trace_entry:
 
 illegal_syscall:
        /* This also isn't a 64-bit syscall, throw an error.  */
-       li      v0, ENOSYS                      # error
+       li      v0, -ENOSYS                     # error
        sd      v0, PT_R2(sp)
        li      t0, 1                           # set error flag
        sd      t0, PT_R7(sp)
@@ -172,19 +177,7 @@ illegal_syscall:
        sd      zero, PT_R7(sp)         # success
        sd      v0, PT_R2(sp)           # result
 
-       /* Success, so skip usual error handling garbage.  */
-       LONG_L  a2, TI_FLAGS($28)       # syscall tracing enabled?
-       li      t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
-       and     t0, a2, t0
-       bnez    t0, 1f
-
-       j       n64_syscall_exit
-
-1:     SAVE_STATIC
-       move    a0, sp
-       li      a1, 1
-       jal     do_syscall_trace
-       j       syscall_exit
+       j       n64_syscall_exit        # continue like a normal syscall
 
 no_mem:        li      v0, -ENOMEM
        jr      ra
@@ -441,9 +434,35 @@ sys_call_table:
        PTR     sys_mq_timedreceive
        PTR     sys_mq_notify
        PTR     sys_mq_getsetattr               /* 5235 */
-       PTR     sys_ni_syscall                  /* sys_vserver */
+       PTR     sys_vserver
        PTR     sys_waitid
        PTR     sys_ni_syscall                  /* available, was setaltroot */
        PTR     sys_add_key
        PTR     sys_request_key                 /* 5240 */
        PTR     sys_keyctl
+       PTR     sys_set_thread_area
+       PTR     sys_inotify_init
+       PTR     sys_inotify_add_watch
+       PTR     sys_inotify_rm_watch            /* 5245 */
+       PTR     sys_migrate_pages
+       PTR     sys_openat
+       PTR     sys_mkdirat
+       PTR     sys_mknodat
+       PTR     sys_fchownat                    /* 5250 */
+       PTR     sys_futimesat
+       PTR     sys_newfstatat
+       PTR     sys_unlinkat
+       PTR     sys_renameat
+       PTR     sys_linkat                      /* 5255 */
+       PTR     sys_symlinkat
+       PTR     sys_readlinkat
+       PTR     sys_fchmodat
+       PTR     sys_faccessat
+       PTR     sys_pselect6                    /* 5260 */
+       PTR     sys_ppoll
+       PTR     sys_unshare
+       PTR     sys_splice
+       PTR     sys_sync_file_range
+       PTR     sys_tee                         /* 5265 */
+       PTR     sys_vmsplice
+       PTR     sys_move_pages