linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ths@linux-mips.org
Date: Fri, 07 Jan 2005 13:03:36 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ths@ftp.linux-mips.org  05/01/07 13:03:30

Modified files:
        arch/mips/kernel: scall32-o32.S scall64-o32.S 

Log message:
        Return -EINVAL instead of -ENOSYS for invalid arguments to syscall(2).

diff -urN linux/arch/mips/kernel/scall32-o32.S 
linux/arch/mips/kernel/scall32-o32.S
--- linux/arch/mips/kernel/scall32-o32.S        2005/01/07 04:26:49     1.21
+++ linux/arch/mips/kernel/scall32-o32.S        2005/01/07 13:03:30     1.22
@@ -280,7 +280,7 @@
        sltiu   v0, t0, __NR_O32_Linux_syscalls + 1
 #endif
        sll     t1, t0, 3
-       beqz    v0, enosys
+       beqz    v0, einval
 
        lw      t2, sys_call_table(t1)          # syscall routine
 
@@ -289,10 +289,8 @@
 #else
        li      v1, 4000 - __NR_O32_Linux       # index of sys_syscall
 #endif
-       beqz    t2, enosys                      # null function pointer?
-
-       li      v0, -EINVAL
-       beq     t0, v1, out                     # do not recurse
+       beqz    t2, einval                      # null function pointer?
+       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
@@ -317,9 +315,8 @@
        jr      t2
        /* Unreached */
 
-enosys:        li      v0, -ENOSYS
-
-out:   jr      ra
+einval:        li      v0, -EINVAL
+       jr      ra
        END(sys_syscall)
 
        .macro  fifty ptr, nargs, from=1, to=50
diff -urN linux/arch/mips/kernel/scall64-o32.S 
linux/arch/mips/kernel/scall64-o32.S
--- linux/arch/mips/kernel/scall64-o32.S        2005/01/06 21:38:38     1.28
+++ linux/arch/mips/kernel/scall64-o32.S        2005/01/07 13:03:30     1.29
@@ -172,16 +172,14 @@
 
 LEAF(sys32_syscall)
        sltu    v0, a0, __NR_O32_Linux + __NR_O32_Linux_syscalls + 1
-       beqz    v0, enosys
+       beqz    v0, einval
 
        dsll    v0, a0, 3
        ld      t2, (sys_call_table - (__NR_O32_Linux * 8))(v0)
 
        li      v1, 4000                # indirect syscall number
-       li      v0, -EINVAL
-       beq     a0, v1, out             # do not recurse
-
-       beqz    t2, enosys              # null function pointer?
+       beqz    t2, einval              # null function pointer?
+       beq     a0, v1, einval          # do not recurse
 
        move    a0, a1                  # shift argument registers
        move    a1, a2
@@ -198,9 +196,8 @@
        jr      t2
        /* Unreached */
 
-enosys:        li      v0, -ENOSYS
-
-out:   jr      ra
+einval:        li      v0, -EINVAL
+       jr      ra
        END(sys32_syscall)
 
        .align  3

<Prev in Thread] Current Thread [Next in Thread>