s390/compat: convert to COMPAT_SYSCALL_DEFINEx part 4
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 26 Feb 2014 09:58:09 +0000 (10:58 +0100)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 4 Mar 2014 08:05:36 +0000 (09:05 +0100)
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_linux.h
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/syscalls.S

index 65b5acbd375bc9c05f046b97a533f4136bf4d8d4..79571343bc759ec057814abcd975c0430fed04a6 100644 (file)
@@ -269,22 +269,22 @@ COMPAT_SYSCALL_DEFINE2(s390_setgroups16, int, gidsetsize, u16 __user *, grouplis
        return retval;
 }
 
-asmlinkage long sys32_getuid16(void)
+COMPAT_SYSCALL_DEFINE0(s390_getuid16)
 {
        return high2lowuid(from_kuid_munged(current_user_ns(), current_uid()));
 }
 
-asmlinkage long sys32_geteuid16(void)
+COMPAT_SYSCALL_DEFINE0(s390_geteuid16)
 {
        return high2lowuid(from_kuid_munged(current_user_ns(), current_euid()));
 }
 
-asmlinkage long sys32_getgid16(void)
+COMPAT_SYSCALL_DEFINE0(s390_getgid16)
 {
        return high2lowgid(from_kgid_munged(current_user_ns(), current_gid()));
 }
 
-asmlinkage long sys32_getegid16(void)
+COMPAT_SYSCALL_DEFINE0(s390_getegid16)
 {
        return high2lowgid(from_kgid_munged(current_user_ns(), current_egid()));
 }
@@ -299,12 +299,9 @@ COMPAT_SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, compat_ulong_t, second,
 }
 #endif
 
-asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low)
+COMPAT_SYSCALL_DEFINE3(s390_truncate64, const char __user *, path, u32, high, u32, low)
 {
-       if ((int)high < 0)
-               return -EINVAL;
-       else
-               return sys_truncate(path, (high << 32) | low);
+       return sys_truncate(path, (unsigned long)high << 32 | low);
 }
 
 asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low)
index 766867230d266066a73eb4c518ab3a8236573603..3e03325d0e9551e4c8465344dd93cbf65bb725fb 100644 (file)
@@ -91,12 +91,11 @@ long compat_sys_s390_setfsuid16(u16 uid);
 long compat_sys_s390_setfsgid16(u16 gid);
 long compat_sys_s390_getgroups16(int gidsetsize, u16 __user *grouplist);
 long compat_sys_s390_setgroups16(int gidsetsize, u16 __user *grouplist);
-long sys32_getuid16(void);
-long sys32_geteuid16(void);
-long sys32_getgid16(void);
-long sys32_getegid16(void);
-long sys32_truncate64(const char __user * path, unsigned long high,
-                     unsigned long low);
+long compat_sys_s390_getuid16(void);
+long compat_sys_s390_geteuid16(void);
+long compat_sys_s390_getgid16(void);
+long compat_sys_s390_getegid16(void);
+long compat_sys_s390_truncate64(const char __user *path, u32 high, u32 low);
 long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low);
 long sys32_init_module(void __user *umod, unsigned long len,
                       const char __user *uargs);
index 6c55523acf29fec54b913d27877686f7692d1f97..9128f7b87e80d9d5f09b1bb6a37f28c72d5a376a 100644 (file)
@@ -75,8 +75,6 @@ ENTRY(sys32_oldumount_wrapper)
        llgtr   %r2,%r2                 # char *
        jg      sys_oldumount           # branch to system call
 
-#sys32_getuid16_wrapper                        # void
-
 ENTRY(sys32_ptrace_wrapper)
        lgfr    %r2,%r2                 # long
        lgfr    %r3,%r3                 # long
@@ -139,17 +137,11 @@ ENTRY(sys32_brk_wrapper)
        llgtr   %r2,%r2                 # unsigned long
        jg      sys_brk                 # branch to system call
 
-#sys32_getgid16_wrapper                        # void
-
 ENTRY(sys32_signal_wrapper)
        lgfr    %r2,%r2                 # int
        llgtr   %r3,%r3                 # __sighandler_t
        jg      sys_signal
 
-#sys32_geteuid16_wrapper               # void
-
-#sys32_getegid16_wrapper               # void
-
 ENTRY(sys32_acct_wrapper)
        llgtr   %r2,%r2                 # char *
        jg      sys_acct                # branch to system call
@@ -577,12 +569,6 @@ ENTRY(sys32_capset_wrapper)
 
 #sys32_vfork_wrapper                   # done in vfork_glue
 
-ENTRY(sys32_truncate64_wrapper)
-       llgtr   %r2,%r2                 # const char *
-       llgfr   %r3,%r3                 # unsigned long
-       llgfr   %r4,%r4                 # unsigned long
-       jg      sys32_truncate64        # branch to system call
-
 ENTRY(sys32_ftruncate64_wrapper)
        llgfr   %r2,%r2                 # unsigned int
        llgfr   %r3,%r3                 # unsigned long
index bdba42a35ec601ae03a802e16c6dd5dca80b6dfd..fa17cefe40e23d07a2eb9ca35cb5ce1780b3c3fb 100644 (file)
@@ -32,7 +32,7 @@ SYSCALL(sys_getpid,sys_getpid,sys_getpid)                     /* 20 */
 SYSCALL(sys_mount,sys_mount,sys32_mount_wrapper)
 SYSCALL(sys_oldumount,sys_oldumount,sys32_oldumount_wrapper)
 SYSCALL(sys_setuid16,sys_ni_syscall,compat_sys_s390_setuid16)  /* old setuid16 syscall*/
-SYSCALL(sys_getuid16,sys_ni_syscall,sys32_getuid16)            /* old getuid16 syscall*/
+SYSCALL(sys_getuid16,sys_ni_syscall,compat_sys_s390_getuid16)  /* old getuid16 syscall*/
 SYSCALL(sys_stime,sys_ni_syscall,sys32_stime_wrapper)          /* 25 old stime syscall */
 SYSCALL(sys_ptrace,sys_ptrace,sys32_ptrace_wrapper)
 SYSCALL(sys_alarm,sys_alarm,sys32_alarm_wrapper)
@@ -55,10 +55,10 @@ SYSCALL(sys_times,sys_times,compat_sys_times_wrapper)
 NI_SYSCALL                                                     /* old prof syscall */
 SYSCALL(sys_brk,sys_brk,sys32_brk_wrapper)                     /* 45 */
 SYSCALL(sys_setgid16,sys_ni_syscall,compat_sys_s390_setgid16)  /* old setgid16 syscall*/
-SYSCALL(sys_getgid16,sys_ni_syscall,sys32_getgid16)            /* old getgid16 syscall*/
+SYSCALL(sys_getgid16,sys_ni_syscall,compat_sys_s390_getgid16)  /* old getgid16 syscall*/
 SYSCALL(sys_signal,sys_signal,sys32_signal_wrapper)
-SYSCALL(sys_geteuid16,sys_ni_syscall,sys32_geteuid16)          /* old geteuid16 syscall */
-SYSCALL(sys_getegid16,sys_ni_syscall,sys32_getegid16)          /* 50 old getegid16 syscall */
+SYSCALL(sys_geteuid16,sys_ni_syscall,compat_sys_s390_geteuid16)        /* old geteuid16 syscall */
+SYSCALL(sys_getegid16,sys_ni_syscall,compat_sys_s390_getegid16)        /* 50 old getegid16 syscall */
 SYSCALL(sys_acct,sys_acct,sys32_acct_wrapper)
 SYSCALL(sys_umount,sys_umount,sys32_umount_wrapper)
 NI_SYSCALL                                                     /* old lock syscall */
@@ -201,7 +201,7 @@ NI_SYSCALL                                                  /* streams2 */
 SYSCALL(sys_vfork,sys_vfork,sys_vfork)                         /* 190 */
 SYSCALL(sys_getrlimit,sys_getrlimit,compat_sys_getrlimit_wrapper)
 SYSCALL(sys_mmap2,sys_mmap2,sys32_mmap2_wrapper)
-SYSCALL(sys_truncate64,sys_ni_syscall,sys32_truncate64_wrapper)
+SYSCALL(sys_truncate64,sys_ni_syscall,compat_sys_s390_truncate64)
 SYSCALL(sys_ftruncate64,sys_ni_syscall,sys32_ftruncate64_wrapper)
 SYSCALL(sys_stat64,sys_ni_syscall,sys32_stat64_wrapper)                /* 195 */
 SYSCALL(sys_lstat64,sys_ni_syscall,sys32_lstat64_wrapper)