Merge branches 'tracing/ftrace', 'tracing/ring-buffer' and 'tracing/urgent' into...
[safe/jmp/linux-2.6] / arch / mips / kernel / scall32-o32.S
index 4e36b87..d0916a5 100644 (file)
@@ -3,14 +3,14 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 by Ralf Baechle
+ * Copyright (C) 1995-99, 2000- 02, 06 Ralf Baechle <ralf@linux-mips.org>
  * Copyright (C) 2001 MIPS Technologies, Inc.
  * Copyright (C) 2004 Thiemo Seufer
  */
-#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>
 NESTED(handle_sys, PT_SIZE, sp)
        .set    noat
        SAVE_SOME
+       TRACE_IRQS_ON_RELOAD
        STI
        .set    at
 
        lw      t1, PT_EPC(sp)          # skip syscall on return
 
-#if defined(CONFIG_BINFMT_IRIX)
-       sltiu   t0, v0, MAX_SYSCALL_NO + 1 # check syscall number
-#else
        subu    v0, v0, __NR_O32_Linux  # check syscall number
        sltiu   t0, v0, __NR_O32_Linux_syscalls + 1
-#endif
        addiu   t1, 4                   # skip to next instruction
        sw      t1, PT_EPC(sp)
        beqz    t0, illegal_syscall
@@ -183,7 +180,7 @@ bad_stack:
         * The system call does not exist in this kernel
         */
 illegal_syscall:
-       li      v0, -ENOSYS                     # error
+       li      v0, ENOSYS                      # error
        sw      v0, PT_R2(sp)
        li      t0, 1                           # set error flag
        sw      t0, PT_R7(sp)
@@ -263,24 +260,13 @@ bad_alignment:
        END(sys_sysmips)
 
        LEAF(sys_syscall)
-#if defined(CONFIG_BINFMT_IRIX)
-       sltiu   v0, a0, MAX_SYSCALL_NO + 1 # check syscall number
-#else
        subu    t0, a0, __NR_O32_Linux  # check syscall number
        sltiu   v0, t0, __NR_O32_Linux_syscalls + 1
-#endif
+       beqz    t0, einval              # do not recurse
        sll     t1, t0, 3
        beqz    v0, einval
-
        lw      t2, sys_call_table(t1)          # syscall routine
 
-#if defined(CONFIG_BINFMT_IRIX)
-       li      v1, 4000                        # nr of sys_syscall
-#else
-       li      v1, 4000 - __NR_O32_Linux       # index of sys_syscall
-#endif
-       beq     t0, v1, einval                  # do not recurse
-
        /* Some syscalls like execve get their arguments from struct pt_regs
           and claim zero arguments in the syscall table. Thus we have to
           assume the worst case and shuffle around all potential arguments.
@@ -304,7 +290,7 @@ bad_alignment:
        jr      t2
        /* Unreached */
 
-einval:        li      v0, -EINVAL
+einval:        li      v0, -ENOSYS
        jr      ra
        END(sys_syscall)
 
@@ -323,13 +309,6 @@ einval:    li      v0, -EINVAL
        .endm
 
        .macro  syscalltable
-#if defined(CONFIG_BINFMT_IRIX)
-       mille   sys_ni_syscall          0       /*    0 -  999 SVR4 flavour */
-       mille   sys_ni_syscall          0       /* 1000 - 1999 32-bit IRIX */
-       mille   sys_ni_syscall          0       /* 2000 - 2999 BSD43 flavour */
-       mille   sys_ni_syscall          0       /* 3000 - 3999 POSIX flavour */
-#endif
-
        sys     sys_syscall             8       /* 4000 */
        sys     sys_exit                1
        sys     sys_fork                0
@@ -372,7 +351,7 @@ einval:     li      v0, -EINVAL
        sys     sys_mkdir               2
        sys     sys_rmdir               1       /* 4040 */
        sys     sys_dup                 1
-       sys     sys_pipe                0
+       sys     sysm_pipe               0
        sys     sys_times               1
        sys     sys_ni_syscall          0
        sys     sys_brk                 1       /* 4045 */
@@ -497,7 +476,7 @@ einval:     li      v0, -EINVAL
        sys     sys_sched_get_priority_min 1
        sys     sys_sched_rr_get_interval 2     /* 4165 */
        sys     sys_nanosleep,          2
-       sys     sys_mremap,             4
+       sys     sys_mremap,             5
        sys     sys_accept              3
        sys     sys_bind                3
        sys     sys_connect             3       /* 4170 */
@@ -569,8 +548,19 @@ einval:    li      v0, -EINVAL
        sys     sys_tkill               2
        sys     sys_sendfile64          5
        sys     sys_futex               6
+#ifdef CONFIG_MIPS_MT_FPAFF
+       /*
+        * For FPU affinity scheduling on MIPS MT processors, we need to
+        * intercept sys_sched_xxxaffinity() calls until we get a proper hook
+        * in kernel/sched.c.  Considered only temporary we only support these
+        * hooks for the 32-bit kernel - there is no MIPS64 MT processor atm.
+        */
+       sys     mipsmt_sys_sched_setaffinity    3
+       sys     mipsmt_sys_sched_getaffinity    3
+#else
        sys     sys_sched_setaffinity   3
        sys     sys_sched_getaffinity   3       /* 4240 */
+#endif /* CONFIG_MIPS_MT_FPAFF */
        sys     sys_io_setup            2
        sys     sys_io_destroy          1
        sys     sys_io_getevents        5
@@ -634,8 +624,32 @@ einval:    li      v0, -EINVAL
        sys     sys_pselect6            6
        sys     sys_ppoll               5
        sys     sys_unshare             1
-       sys     sys_splice              4
+       sys     sys_splice              6
        sys     sys_sync_file_range     7       /* 4305 */
+       sys     sys_tee                 4
+       sys     sys_vmsplice            4
+       sys     sys_move_pages          6
+       sys     sys_set_robust_list     2
+       sys     sys_get_robust_list     3       /* 4310 */
+       sys     sys_kexec_load          4
+       sys     sys_getcpu              3
+       sys     sys_epoll_pwait         6
+       sys     sys_ioprio_set          3
+       sys     sys_ioprio_get          2       /* 4315 */
+       sys     sys_utimensat           4
+       sys     sys_signalfd            3
+       sys     sys_ni_syscall          0
+       sys     sys_eventfd             1
+       sys     sys_fallocate           6       /* 4320 */
+       sys     sys_timerfd_create      2
+       sys     sys_timerfd_gettime     2
+       sys     sys_timerfd_settime     4
+       sys     sys_signalfd4           4
+       sys     sys_eventfd2            2       /* 4325 */
+       sys     sys_epoll_create1       1
+       sys     sys_dup3                3
+       sys     sys_pipe2               2
+       sys     sys_inotify_init1       1
        .endm
 
        /* We pre-compute the number of _instruction_ bytes needed to