1a88b5ba8SSam Ravnborg /* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. 2a88b5ba8SSam Ravnborg * 3a88b5ba8SSam Ravnborg * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 4a88b5ba8SSam Ravnborg * Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net) 5a88b5ba8SSam Ravnborg * 6a88b5ba8SSam Ravnborg * These routines maintain argument size conversion between 32bit and 64bit 7a88b5ba8SSam Ravnborg * environment. 8a88b5ba8SSam Ravnborg */ 9a88b5ba8SSam Ravnborg 10a88b5ba8SSam Ravnborg #include <linux/kernel.h> 11a88b5ba8SSam Ravnborg #include <linux/sched.h> 12a88b5ba8SSam Ravnborg #include <linux/capability.h> 13a88b5ba8SSam Ravnborg #include <linux/fs.h> 14a88b5ba8SSam Ravnborg #include <linux/mm.h> 15a88b5ba8SSam Ravnborg #include <linux/file.h> 16a88b5ba8SSam Ravnborg #include <linux/signal.h> 17a88b5ba8SSam Ravnborg #include <linux/resource.h> 18a88b5ba8SSam Ravnborg #include <linux/times.h> 19a88b5ba8SSam Ravnborg #include <linux/utsname.h> 20a88b5ba8SSam Ravnborg #include <linux/smp.h> 21a88b5ba8SSam Ravnborg #include <linux/smp_lock.h> 22a88b5ba8SSam Ravnborg #include <linux/sem.h> 23a88b5ba8SSam Ravnborg #include <linux/msg.h> 24a88b5ba8SSam Ravnborg #include <linux/shm.h> 25a88b5ba8SSam Ravnborg #include <linux/slab.h> 26a88b5ba8SSam Ravnborg #include <linux/uio.h> 27a88b5ba8SSam Ravnborg #include <linux/nfs_fs.h> 28a88b5ba8SSam Ravnborg #include <linux/quota.h> 29a88b5ba8SSam Ravnborg #include <linux/module.h> 30a88b5ba8SSam Ravnborg #include <linux/sunrpc/svc.h> 31a88b5ba8SSam Ravnborg #include <linux/nfsd/nfsd.h> 32a88b5ba8SSam Ravnborg #include <linux/nfsd/cache.h> 33a88b5ba8SSam Ravnborg #include <linux/nfsd/xdr.h> 34a88b5ba8SSam Ravnborg #include <linux/nfsd/syscall.h> 35a88b5ba8SSam Ravnborg #include <linux/poll.h> 36a88b5ba8SSam Ravnborg #include <linux/personality.h> 37a88b5ba8SSam Ravnborg #include <linux/stat.h> 38a88b5ba8SSam Ravnborg #include <linux/filter.h> 39a88b5ba8SSam Ravnborg #include <linux/highmem.h> 40a88b5ba8SSam Ravnborg #include <linux/highuid.h> 41a88b5ba8SSam Ravnborg #include <linux/mman.h> 42a88b5ba8SSam Ravnborg #include <linux/ipv6.h> 43a88b5ba8SSam Ravnborg #include <linux/in.h> 44a88b5ba8SSam Ravnborg #include <linux/icmpv6.h> 45a88b5ba8SSam Ravnborg #include <linux/syscalls.h> 46a88b5ba8SSam Ravnborg #include <linux/sysctl.h> 47a88b5ba8SSam Ravnborg #include <linux/binfmts.h> 48a88b5ba8SSam Ravnborg #include <linux/dnotify.h> 49a88b5ba8SSam Ravnborg #include <linux/security.h> 50a88b5ba8SSam Ravnborg #include <linux/compat.h> 51a88b5ba8SSam Ravnborg #include <linux/vfs.h> 52a88b5ba8SSam Ravnborg #include <linux/netfilter_ipv4/ip_tables.h> 53a88b5ba8SSam Ravnborg #include <linux/ptrace.h> 54a88b5ba8SSam Ravnborg 55a88b5ba8SSam Ravnborg #include <asm/types.h> 56a88b5ba8SSam Ravnborg #include <asm/uaccess.h> 57a88b5ba8SSam Ravnborg #include <asm/fpumacro.h> 58a88b5ba8SSam Ravnborg #include <asm/mmu_context.h> 59a88b5ba8SSam Ravnborg #include <asm/compat_signal.h> 60a88b5ba8SSam Ravnborg 61a88b5ba8SSam Ravnborg #ifdef CONFIG_SYSVIPC 62a88b5ba8SSam Ravnborg asmlinkage long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, u32 fifth) 63a88b5ba8SSam Ravnborg { 64a88b5ba8SSam Ravnborg int version; 65a88b5ba8SSam Ravnborg 66a88b5ba8SSam Ravnborg version = call >> 16; /* hack for backward compatibility */ 67a88b5ba8SSam Ravnborg call &= 0xffff; 68a88b5ba8SSam Ravnborg 69a88b5ba8SSam Ravnborg switch (call) { 70a88b5ba8SSam Ravnborg case SEMTIMEDOP: 71a88b5ba8SSam Ravnborg if (fifth) 72a88b5ba8SSam Ravnborg /* sign extend semid */ 73a88b5ba8SSam Ravnborg return compat_sys_semtimedop((int)first, 74a88b5ba8SSam Ravnborg compat_ptr(ptr), second, 75a88b5ba8SSam Ravnborg compat_ptr(fifth)); 76a88b5ba8SSam Ravnborg /* else fall through for normal semop() */ 77a88b5ba8SSam Ravnborg case SEMOP: 78a88b5ba8SSam Ravnborg /* struct sembuf is the same on 32 and 64bit :)) */ 79a88b5ba8SSam Ravnborg /* sign extend semid */ 80a88b5ba8SSam Ravnborg return sys_semtimedop((int)first, compat_ptr(ptr), second, 81a88b5ba8SSam Ravnborg NULL); 82a88b5ba8SSam Ravnborg case SEMGET: 83a88b5ba8SSam Ravnborg /* sign extend key, nsems */ 84a88b5ba8SSam Ravnborg return sys_semget((int)first, (int)second, third); 85a88b5ba8SSam Ravnborg case SEMCTL: 86a88b5ba8SSam Ravnborg /* sign extend semid, semnum */ 87a88b5ba8SSam Ravnborg return compat_sys_semctl((int)first, (int)second, third, 88a88b5ba8SSam Ravnborg compat_ptr(ptr)); 89a88b5ba8SSam Ravnborg 90a88b5ba8SSam Ravnborg case MSGSND: 91a88b5ba8SSam Ravnborg /* sign extend msqid */ 92a88b5ba8SSam Ravnborg return compat_sys_msgsnd((int)first, (int)second, third, 93a88b5ba8SSam Ravnborg compat_ptr(ptr)); 94a88b5ba8SSam Ravnborg case MSGRCV: 95a88b5ba8SSam Ravnborg /* sign extend msqid, msgtyp */ 96a88b5ba8SSam Ravnborg return compat_sys_msgrcv((int)first, second, (int)fifth, 97a88b5ba8SSam Ravnborg third, version, compat_ptr(ptr)); 98a88b5ba8SSam Ravnborg case MSGGET: 99a88b5ba8SSam Ravnborg /* sign extend key */ 100a88b5ba8SSam Ravnborg return sys_msgget((int)first, second); 101a88b5ba8SSam Ravnborg case MSGCTL: 102a88b5ba8SSam Ravnborg /* sign extend msqid */ 103a88b5ba8SSam Ravnborg return compat_sys_msgctl((int)first, second, compat_ptr(ptr)); 104a88b5ba8SSam Ravnborg 105a88b5ba8SSam Ravnborg case SHMAT: 106a88b5ba8SSam Ravnborg /* sign extend shmid */ 107a88b5ba8SSam Ravnborg return compat_sys_shmat((int)first, second, third, version, 108a88b5ba8SSam Ravnborg compat_ptr(ptr)); 109a88b5ba8SSam Ravnborg case SHMDT: 110a88b5ba8SSam Ravnborg return sys_shmdt(compat_ptr(ptr)); 111a88b5ba8SSam Ravnborg case SHMGET: 112a88b5ba8SSam Ravnborg /* sign extend key_t */ 113a88b5ba8SSam Ravnborg return sys_shmget((int)first, second, third); 114a88b5ba8SSam Ravnborg case SHMCTL: 115a88b5ba8SSam Ravnborg /* sign extend shmid */ 116a88b5ba8SSam Ravnborg return compat_sys_shmctl((int)first, second, compat_ptr(ptr)); 117a88b5ba8SSam Ravnborg 118a88b5ba8SSam Ravnborg default: 119a88b5ba8SSam Ravnborg return -ENOSYS; 120a88b5ba8SSam Ravnborg }; 121a88b5ba8SSam Ravnborg 122a88b5ba8SSam Ravnborg return -ENOSYS; 123a88b5ba8SSam Ravnborg } 124a88b5ba8SSam Ravnborg #endif 125a88b5ba8SSam Ravnborg 126a88b5ba8SSam Ravnborg asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low) 127a88b5ba8SSam Ravnborg { 128a88b5ba8SSam Ravnborg if ((int)high < 0) 129a88b5ba8SSam Ravnborg return -EINVAL; 130a88b5ba8SSam Ravnborg else 131a88b5ba8SSam Ravnborg return sys_truncate(path, (high << 32) | low); 132a88b5ba8SSam Ravnborg } 133a88b5ba8SSam Ravnborg 134a88b5ba8SSam Ravnborg asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low) 135a88b5ba8SSam Ravnborg { 136a88b5ba8SSam Ravnborg if ((int)high < 0) 137a88b5ba8SSam Ravnborg return -EINVAL; 138a88b5ba8SSam Ravnborg else 139a88b5ba8SSam Ravnborg return sys_ftruncate(fd, (high << 32) | low); 140a88b5ba8SSam Ravnborg } 141a88b5ba8SSam Ravnborg 142a88b5ba8SSam Ravnborg static int cp_compat_stat64(struct kstat *stat, 143a88b5ba8SSam Ravnborg struct compat_stat64 __user *statbuf) 144a88b5ba8SSam Ravnborg { 145a88b5ba8SSam Ravnborg int err; 146a88b5ba8SSam Ravnborg 147a88b5ba8SSam Ravnborg err = put_user(huge_encode_dev(stat->dev), &statbuf->st_dev); 148a88b5ba8SSam Ravnborg err |= put_user(stat->ino, &statbuf->st_ino); 149a88b5ba8SSam Ravnborg err |= put_user(stat->mode, &statbuf->st_mode); 150a88b5ba8SSam Ravnborg err |= put_user(stat->nlink, &statbuf->st_nlink); 151a88b5ba8SSam Ravnborg err |= put_user(stat->uid, &statbuf->st_uid); 152a88b5ba8SSam Ravnborg err |= put_user(stat->gid, &statbuf->st_gid); 153a88b5ba8SSam Ravnborg err |= put_user(huge_encode_dev(stat->rdev), &statbuf->st_rdev); 154a88b5ba8SSam Ravnborg err |= put_user(0, (unsigned long __user *) &statbuf->__pad3[0]); 155a88b5ba8SSam Ravnborg err |= put_user(stat->size, &statbuf->st_size); 156a88b5ba8SSam Ravnborg err |= put_user(stat->blksize, &statbuf->st_blksize); 157a88b5ba8SSam Ravnborg err |= put_user(0, (unsigned int __user *) &statbuf->__pad4[0]); 158a88b5ba8SSam Ravnborg err |= put_user(0, (unsigned int __user *) &statbuf->__pad4[4]); 159a88b5ba8SSam Ravnborg err |= put_user(stat->blocks, &statbuf->st_blocks); 160a88b5ba8SSam Ravnborg err |= put_user(stat->atime.tv_sec, &statbuf->st_atime); 161a88b5ba8SSam Ravnborg err |= put_user(stat->atime.tv_nsec, &statbuf->st_atime_nsec); 162a88b5ba8SSam Ravnborg err |= put_user(stat->mtime.tv_sec, &statbuf->st_mtime); 163a88b5ba8SSam Ravnborg err |= put_user(stat->mtime.tv_nsec, &statbuf->st_mtime_nsec); 164a88b5ba8SSam Ravnborg err |= put_user(stat->ctime.tv_sec, &statbuf->st_ctime); 165a88b5ba8SSam Ravnborg err |= put_user(stat->ctime.tv_nsec, &statbuf->st_ctime_nsec); 166a88b5ba8SSam Ravnborg err |= put_user(0, &statbuf->__unused4); 167a88b5ba8SSam Ravnborg err |= put_user(0, &statbuf->__unused5); 168a88b5ba8SSam Ravnborg 169a88b5ba8SSam Ravnborg return err; 170a88b5ba8SSam Ravnborg } 171a88b5ba8SSam Ravnborg 172a88b5ba8SSam Ravnborg asmlinkage long compat_sys_stat64(char __user * filename, 173a88b5ba8SSam Ravnborg struct compat_stat64 __user *statbuf) 174a88b5ba8SSam Ravnborg { 175a88b5ba8SSam Ravnborg struct kstat stat; 176a88b5ba8SSam Ravnborg int error = vfs_stat(filename, &stat); 177a88b5ba8SSam Ravnborg 178a88b5ba8SSam Ravnborg if (!error) 179a88b5ba8SSam Ravnborg error = cp_compat_stat64(&stat, statbuf); 180a88b5ba8SSam Ravnborg return error; 181a88b5ba8SSam Ravnborg } 182a88b5ba8SSam Ravnborg 183a88b5ba8SSam Ravnborg asmlinkage long compat_sys_lstat64(char __user * filename, 184a88b5ba8SSam Ravnborg struct compat_stat64 __user *statbuf) 185a88b5ba8SSam Ravnborg { 186a88b5ba8SSam Ravnborg struct kstat stat; 187a88b5ba8SSam Ravnborg int error = vfs_lstat(filename, &stat); 188a88b5ba8SSam Ravnborg 189a88b5ba8SSam Ravnborg if (!error) 190a88b5ba8SSam Ravnborg error = cp_compat_stat64(&stat, statbuf); 191a88b5ba8SSam Ravnborg return error; 192a88b5ba8SSam Ravnborg } 193a88b5ba8SSam Ravnborg 194a88b5ba8SSam Ravnborg asmlinkage long compat_sys_fstat64(unsigned int fd, 195a88b5ba8SSam Ravnborg struct compat_stat64 __user * statbuf) 196a88b5ba8SSam Ravnborg { 197a88b5ba8SSam Ravnborg struct kstat stat; 198a88b5ba8SSam Ravnborg int error = vfs_fstat(fd, &stat); 199a88b5ba8SSam Ravnborg 200a88b5ba8SSam Ravnborg if (!error) 201a88b5ba8SSam Ravnborg error = cp_compat_stat64(&stat, statbuf); 202a88b5ba8SSam Ravnborg return error; 203a88b5ba8SSam Ravnborg } 204a88b5ba8SSam Ravnborg 205a88b5ba8SSam Ravnborg asmlinkage long compat_sys_fstatat64(unsigned int dfd, char __user *filename, 206a88b5ba8SSam Ravnborg struct compat_stat64 __user * statbuf, int flag) 207a88b5ba8SSam Ravnborg { 208a88b5ba8SSam Ravnborg struct kstat stat; 209*0112fc22SOleg Drokin int error; 210a88b5ba8SSam Ravnborg 211*0112fc22SOleg Drokin error = vfs_fstatat(dfd, filename, &stat, flag); 212*0112fc22SOleg Drokin if (error) 213a88b5ba8SSam Ravnborg return error; 214*0112fc22SOleg Drokin return cp_compat_stat64(&stat, statbuf); 215a88b5ba8SSam Ravnborg } 216a88b5ba8SSam Ravnborg 217a88b5ba8SSam Ravnborg asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2) 218a88b5ba8SSam Ravnborg { 219a88b5ba8SSam Ravnborg return sys_sysfs(option, arg1, arg2); 220a88b5ba8SSam Ravnborg } 221a88b5ba8SSam Ravnborg 222a88b5ba8SSam Ravnborg asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval) 223a88b5ba8SSam Ravnborg { 224a88b5ba8SSam Ravnborg struct timespec t; 225a88b5ba8SSam Ravnborg int ret; 226a88b5ba8SSam Ravnborg mm_segment_t old_fs = get_fs (); 227a88b5ba8SSam Ravnborg 228a88b5ba8SSam Ravnborg set_fs (KERNEL_DS); 229a88b5ba8SSam Ravnborg ret = sys_sched_rr_get_interval(pid, (struct timespec __user *) &t); 230a88b5ba8SSam Ravnborg set_fs (old_fs); 231a88b5ba8SSam Ravnborg if (put_compat_timespec(&t, interval)) 232a88b5ba8SSam Ravnborg return -EFAULT; 233a88b5ba8SSam Ravnborg return ret; 234a88b5ba8SSam Ravnborg } 235a88b5ba8SSam Ravnborg 236a88b5ba8SSam Ravnborg asmlinkage long compat_sys_rt_sigprocmask(int how, 237a88b5ba8SSam Ravnborg compat_sigset_t __user *set, 238a88b5ba8SSam Ravnborg compat_sigset_t __user *oset, 239a88b5ba8SSam Ravnborg compat_size_t sigsetsize) 240a88b5ba8SSam Ravnborg { 241a88b5ba8SSam Ravnborg sigset_t s; 242a88b5ba8SSam Ravnborg compat_sigset_t s32; 243a88b5ba8SSam Ravnborg int ret; 244a88b5ba8SSam Ravnborg mm_segment_t old_fs = get_fs(); 245a88b5ba8SSam Ravnborg 246a88b5ba8SSam Ravnborg if (set) { 247a88b5ba8SSam Ravnborg if (copy_from_user (&s32, set, sizeof(compat_sigset_t))) 248a88b5ba8SSam Ravnborg return -EFAULT; 249a88b5ba8SSam Ravnborg switch (_NSIG_WORDS) { 250a88b5ba8SSam Ravnborg case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32); 251a88b5ba8SSam Ravnborg case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32); 252a88b5ba8SSam Ravnborg case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32); 253a88b5ba8SSam Ravnborg case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); 254a88b5ba8SSam Ravnborg } 255a88b5ba8SSam Ravnborg } 256a88b5ba8SSam Ravnborg set_fs (KERNEL_DS); 257a88b5ba8SSam Ravnborg ret = sys_rt_sigprocmask(how, 258a88b5ba8SSam Ravnborg set ? (sigset_t __user *) &s : NULL, 259a88b5ba8SSam Ravnborg oset ? (sigset_t __user *) &s : NULL, 260a88b5ba8SSam Ravnborg sigsetsize); 261a88b5ba8SSam Ravnborg set_fs (old_fs); 262a88b5ba8SSam Ravnborg if (ret) return ret; 263a88b5ba8SSam Ravnborg if (oset) { 264a88b5ba8SSam Ravnborg switch (_NSIG_WORDS) { 265a88b5ba8SSam Ravnborg case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3]; 266a88b5ba8SSam Ravnborg case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2]; 267a88b5ba8SSam Ravnborg case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; 268a88b5ba8SSam Ravnborg case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; 269a88b5ba8SSam Ravnborg } 270a88b5ba8SSam Ravnborg if (copy_to_user (oset, &s32, sizeof(compat_sigset_t))) 271a88b5ba8SSam Ravnborg return -EFAULT; 272a88b5ba8SSam Ravnborg } 273a88b5ba8SSam Ravnborg return 0; 274a88b5ba8SSam Ravnborg } 275a88b5ba8SSam Ravnborg 276a88b5ba8SSam Ravnborg asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, 277a88b5ba8SSam Ravnborg compat_size_t sigsetsize) 278a88b5ba8SSam Ravnborg { 279a88b5ba8SSam Ravnborg sigset_t s; 280a88b5ba8SSam Ravnborg compat_sigset_t s32; 281a88b5ba8SSam Ravnborg int ret; 282a88b5ba8SSam Ravnborg mm_segment_t old_fs = get_fs(); 283a88b5ba8SSam Ravnborg 284a88b5ba8SSam Ravnborg set_fs (KERNEL_DS); 285a88b5ba8SSam Ravnborg ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize); 286a88b5ba8SSam Ravnborg set_fs (old_fs); 287a88b5ba8SSam Ravnborg if (!ret) { 288a88b5ba8SSam Ravnborg switch (_NSIG_WORDS) { 289a88b5ba8SSam Ravnborg case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3]; 290a88b5ba8SSam Ravnborg case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2]; 291a88b5ba8SSam Ravnborg case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; 292a88b5ba8SSam Ravnborg case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; 293a88b5ba8SSam Ravnborg } 294a88b5ba8SSam Ravnborg if (copy_to_user (set, &s32, sizeof(compat_sigset_t))) 295a88b5ba8SSam Ravnborg return -EFAULT; 296a88b5ba8SSam Ravnborg } 297a88b5ba8SSam Ravnborg return ret; 298a88b5ba8SSam Ravnborg } 299a88b5ba8SSam Ravnborg 300a88b5ba8SSam Ravnborg asmlinkage long compat_sys_rt_sigqueueinfo(int pid, int sig, 301a88b5ba8SSam Ravnborg struct compat_siginfo __user *uinfo) 302a88b5ba8SSam Ravnborg { 303a88b5ba8SSam Ravnborg siginfo_t info; 304a88b5ba8SSam Ravnborg int ret; 305a88b5ba8SSam Ravnborg mm_segment_t old_fs = get_fs(); 306a88b5ba8SSam Ravnborg 307a88b5ba8SSam Ravnborg if (copy_siginfo_from_user32(&info, uinfo)) 308a88b5ba8SSam Ravnborg return -EFAULT; 309a88b5ba8SSam Ravnborg 310a88b5ba8SSam Ravnborg set_fs (KERNEL_DS); 311a88b5ba8SSam Ravnborg ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info); 312a88b5ba8SSam Ravnborg set_fs (old_fs); 313a88b5ba8SSam Ravnborg return ret; 314a88b5ba8SSam Ravnborg } 315a88b5ba8SSam Ravnborg 316a88b5ba8SSam Ravnborg asmlinkage long compat_sys_sigaction(int sig, struct old_sigaction32 __user *act, 317a88b5ba8SSam Ravnborg struct old_sigaction32 __user *oact) 318a88b5ba8SSam Ravnborg { 319a88b5ba8SSam Ravnborg struct k_sigaction new_ka, old_ka; 320a88b5ba8SSam Ravnborg int ret; 321a88b5ba8SSam Ravnborg 322a88b5ba8SSam Ravnborg WARN_ON_ONCE(sig >= 0); 323a88b5ba8SSam Ravnborg sig = -sig; 324a88b5ba8SSam Ravnborg 325a88b5ba8SSam Ravnborg if (act) { 326a88b5ba8SSam Ravnborg compat_old_sigset_t mask; 327a88b5ba8SSam Ravnborg u32 u_handler, u_restorer; 328a88b5ba8SSam Ravnborg 329a88b5ba8SSam Ravnborg ret = get_user(u_handler, &act->sa_handler); 330a88b5ba8SSam Ravnborg new_ka.sa.sa_handler = compat_ptr(u_handler); 331a88b5ba8SSam Ravnborg ret |= __get_user(u_restorer, &act->sa_restorer); 332a88b5ba8SSam Ravnborg new_ka.sa.sa_restorer = compat_ptr(u_restorer); 333a88b5ba8SSam Ravnborg ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); 334a88b5ba8SSam Ravnborg ret |= __get_user(mask, &act->sa_mask); 335a88b5ba8SSam Ravnborg if (ret) 336a88b5ba8SSam Ravnborg return ret; 337a88b5ba8SSam Ravnborg new_ka.ka_restorer = NULL; 338a88b5ba8SSam Ravnborg siginitset(&new_ka.sa.sa_mask, mask); 339a88b5ba8SSam Ravnborg } 340a88b5ba8SSam Ravnborg 341a88b5ba8SSam Ravnborg ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 342a88b5ba8SSam Ravnborg 343a88b5ba8SSam Ravnborg if (!ret && oact) { 344a88b5ba8SSam Ravnborg ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); 345a88b5ba8SSam Ravnborg ret |= __put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer); 346a88b5ba8SSam Ravnborg ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 347a88b5ba8SSam Ravnborg ret |= __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 348a88b5ba8SSam Ravnborg } 349a88b5ba8SSam Ravnborg 350a88b5ba8SSam Ravnborg return ret; 351a88b5ba8SSam Ravnborg } 352a88b5ba8SSam Ravnborg 353a88b5ba8SSam Ravnborg asmlinkage long compat_sys_rt_sigaction(int sig, 354a88b5ba8SSam Ravnborg struct sigaction32 __user *act, 355a88b5ba8SSam Ravnborg struct sigaction32 __user *oact, 356a88b5ba8SSam Ravnborg void __user *restorer, 357a88b5ba8SSam Ravnborg compat_size_t sigsetsize) 358a88b5ba8SSam Ravnborg { 359a88b5ba8SSam Ravnborg struct k_sigaction new_ka, old_ka; 360a88b5ba8SSam Ravnborg int ret; 361a88b5ba8SSam Ravnborg compat_sigset_t set32; 362a88b5ba8SSam Ravnborg 363a88b5ba8SSam Ravnborg /* XXX: Don't preclude handling different sized sigset_t's. */ 364a88b5ba8SSam Ravnborg if (sigsetsize != sizeof(compat_sigset_t)) 365a88b5ba8SSam Ravnborg return -EINVAL; 366a88b5ba8SSam Ravnborg 367a88b5ba8SSam Ravnborg if (act) { 368a88b5ba8SSam Ravnborg u32 u_handler, u_restorer; 369a88b5ba8SSam Ravnborg 370a88b5ba8SSam Ravnborg new_ka.ka_restorer = restorer; 371a88b5ba8SSam Ravnborg ret = get_user(u_handler, &act->sa_handler); 372a88b5ba8SSam Ravnborg new_ka.sa.sa_handler = compat_ptr(u_handler); 373a88b5ba8SSam Ravnborg ret |= __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)); 374a88b5ba8SSam Ravnborg switch (_NSIG_WORDS) { 375a88b5ba8SSam Ravnborg case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | (((long)set32.sig[7]) << 32); 376a88b5ba8SSam Ravnborg case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4] | (((long)set32.sig[5]) << 32); 377a88b5ba8SSam Ravnborg case 2: new_ka.sa.sa_mask.sig[1] = set32.sig[2] | (((long)set32.sig[3]) << 32); 378a88b5ba8SSam Ravnborg case 1: new_ka.sa.sa_mask.sig[0] = set32.sig[0] | (((long)set32.sig[1]) << 32); 379a88b5ba8SSam Ravnborg } 380a88b5ba8SSam Ravnborg ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); 381a88b5ba8SSam Ravnborg ret |= __get_user(u_restorer, &act->sa_restorer); 382a88b5ba8SSam Ravnborg new_ka.sa.sa_restorer = compat_ptr(u_restorer); 383a88b5ba8SSam Ravnborg if (ret) 384a88b5ba8SSam Ravnborg return -EFAULT; 385a88b5ba8SSam Ravnborg } 386a88b5ba8SSam Ravnborg 387a88b5ba8SSam Ravnborg ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 388a88b5ba8SSam Ravnborg 389a88b5ba8SSam Ravnborg if (!ret && oact) { 390a88b5ba8SSam Ravnborg switch (_NSIG_WORDS) { 391a88b5ba8SSam Ravnborg case 4: set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32); set32.sig[6] = old_ka.sa.sa_mask.sig[3]; 392a88b5ba8SSam Ravnborg case 3: set32.sig[5] = (old_ka.sa.sa_mask.sig[2] >> 32); set32.sig[4] = old_ka.sa.sa_mask.sig[2]; 393a88b5ba8SSam Ravnborg case 2: set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32); set32.sig[2] = old_ka.sa.sa_mask.sig[1]; 394a88b5ba8SSam Ravnborg case 1: set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32); set32.sig[0] = old_ka.sa.sa_mask.sig[0]; 395a88b5ba8SSam Ravnborg } 396a88b5ba8SSam Ravnborg ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); 397a88b5ba8SSam Ravnborg ret |= __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t)); 398a88b5ba8SSam Ravnborg ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 399a88b5ba8SSam Ravnborg ret |= __put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer); 400a88b5ba8SSam Ravnborg if (ret) 401a88b5ba8SSam Ravnborg ret = -EFAULT; 402a88b5ba8SSam Ravnborg } 403a88b5ba8SSam Ravnborg 404a88b5ba8SSam Ravnborg return ret; 405a88b5ba8SSam Ravnborg } 406a88b5ba8SSam Ravnborg 407a88b5ba8SSam Ravnborg /* 408a88b5ba8SSam Ravnborg * sparc32_execve() executes a new program after the asm stub has set 409a88b5ba8SSam Ravnborg * things up for us. This should basically do what I want it to. 410a88b5ba8SSam Ravnborg */ 411a88b5ba8SSam Ravnborg asmlinkage long sparc32_execve(struct pt_regs *regs) 412a88b5ba8SSam Ravnborg { 413a88b5ba8SSam Ravnborg int error, base = 0; 414a88b5ba8SSam Ravnborg char *filename; 415a88b5ba8SSam Ravnborg 416a88b5ba8SSam Ravnborg /* User register window flush is done by entry.S */ 417a88b5ba8SSam Ravnborg 418a88b5ba8SSam Ravnborg /* Check for indirect call. */ 419a88b5ba8SSam Ravnborg if ((u32)regs->u_regs[UREG_G1] == 0) 420a88b5ba8SSam Ravnborg base = 1; 421a88b5ba8SSam Ravnborg 422a88b5ba8SSam Ravnborg filename = getname(compat_ptr(regs->u_regs[base + UREG_I0])); 423a88b5ba8SSam Ravnborg error = PTR_ERR(filename); 424a88b5ba8SSam Ravnborg if (IS_ERR(filename)) 425a88b5ba8SSam Ravnborg goto out; 426a88b5ba8SSam Ravnborg 427a88b5ba8SSam Ravnborg error = compat_do_execve(filename, 428a88b5ba8SSam Ravnborg compat_ptr(regs->u_regs[base + UREG_I1]), 429a88b5ba8SSam Ravnborg compat_ptr(regs->u_regs[base + UREG_I2]), regs); 430a88b5ba8SSam Ravnborg 431a88b5ba8SSam Ravnborg putname(filename); 432a88b5ba8SSam Ravnborg 433a88b5ba8SSam Ravnborg if (!error) { 434a88b5ba8SSam Ravnborg fprs_write(0); 435a88b5ba8SSam Ravnborg current_thread_info()->xfsr[0] = 0; 436a88b5ba8SSam Ravnborg current_thread_info()->fpsaved[0] = 0; 437a88b5ba8SSam Ravnborg regs->tstate &= ~TSTATE_PEF; 438a88b5ba8SSam Ravnborg } 439a88b5ba8SSam Ravnborg out: 440a88b5ba8SSam Ravnborg return error; 441a88b5ba8SSam Ravnborg } 442a88b5ba8SSam Ravnborg 443a88b5ba8SSam Ravnborg #ifdef CONFIG_MODULES 444a88b5ba8SSam Ravnborg 445a88b5ba8SSam Ravnborg asmlinkage long sys32_init_module(void __user *umod, u32 len, 446a88b5ba8SSam Ravnborg const char __user *uargs) 447a88b5ba8SSam Ravnborg { 448a88b5ba8SSam Ravnborg return sys_init_module(umod, len, uargs); 449a88b5ba8SSam Ravnborg } 450a88b5ba8SSam Ravnborg 451a88b5ba8SSam Ravnborg asmlinkage long sys32_delete_module(const char __user *name_user, 452a88b5ba8SSam Ravnborg unsigned int flags) 453a88b5ba8SSam Ravnborg { 454a88b5ba8SSam Ravnborg return sys_delete_module(name_user, flags); 455a88b5ba8SSam Ravnborg } 456a88b5ba8SSam Ravnborg 457a88b5ba8SSam Ravnborg #else /* CONFIG_MODULES */ 458a88b5ba8SSam Ravnborg 459a88b5ba8SSam Ravnborg asmlinkage long sys32_init_module(const char __user *name_user, 460a88b5ba8SSam Ravnborg struct module __user *mod_user) 461a88b5ba8SSam Ravnborg { 462a88b5ba8SSam Ravnborg return -ENOSYS; 463a88b5ba8SSam Ravnborg } 464a88b5ba8SSam Ravnborg 465a88b5ba8SSam Ravnborg asmlinkage long sys32_delete_module(const char __user *name_user) 466a88b5ba8SSam Ravnborg { 467a88b5ba8SSam Ravnborg return -ENOSYS; 468a88b5ba8SSam Ravnborg } 469a88b5ba8SSam Ravnborg 470a88b5ba8SSam Ravnborg #endif /* CONFIG_MODULES */ 471a88b5ba8SSam Ravnborg 472a88b5ba8SSam Ravnborg asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, 473a88b5ba8SSam Ravnborg char __user *ubuf, 474a88b5ba8SSam Ravnborg compat_size_t count, 475a88b5ba8SSam Ravnborg unsigned long poshi, 476a88b5ba8SSam Ravnborg unsigned long poslo) 477a88b5ba8SSam Ravnborg { 478a88b5ba8SSam Ravnborg return sys_pread64(fd, ubuf, count, (poshi << 32) | poslo); 479a88b5ba8SSam Ravnborg } 480a88b5ba8SSam Ravnborg 481a88b5ba8SSam Ravnborg asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd, 482a88b5ba8SSam Ravnborg char __user *ubuf, 483a88b5ba8SSam Ravnborg compat_size_t count, 484a88b5ba8SSam Ravnborg unsigned long poshi, 485a88b5ba8SSam Ravnborg unsigned long poslo) 486a88b5ba8SSam Ravnborg { 487a88b5ba8SSam Ravnborg return sys_pwrite64(fd, ubuf, count, (poshi << 32) | poslo); 488a88b5ba8SSam Ravnborg } 489a88b5ba8SSam Ravnborg 490a88b5ba8SSam Ravnborg asmlinkage long compat_sys_readahead(int fd, 491a88b5ba8SSam Ravnborg unsigned long offhi, 492a88b5ba8SSam Ravnborg unsigned long offlo, 493a88b5ba8SSam Ravnborg compat_size_t count) 494a88b5ba8SSam Ravnborg { 495a88b5ba8SSam Ravnborg return sys_readahead(fd, (offhi << 32) | offlo, count); 496a88b5ba8SSam Ravnborg } 497a88b5ba8SSam Ravnborg 498a88b5ba8SSam Ravnborg long compat_sys_fadvise64(int fd, 499a88b5ba8SSam Ravnborg unsigned long offhi, 500a88b5ba8SSam Ravnborg unsigned long offlo, 501a88b5ba8SSam Ravnborg compat_size_t len, int advice) 502a88b5ba8SSam Ravnborg { 503a88b5ba8SSam Ravnborg return sys_fadvise64_64(fd, (offhi << 32) | offlo, len, advice); 504a88b5ba8SSam Ravnborg } 505a88b5ba8SSam Ravnborg 506a88b5ba8SSam Ravnborg long compat_sys_fadvise64_64(int fd, 507a88b5ba8SSam Ravnborg unsigned long offhi, unsigned long offlo, 508a88b5ba8SSam Ravnborg unsigned long lenhi, unsigned long lenlo, 509a88b5ba8SSam Ravnborg int advice) 510a88b5ba8SSam Ravnborg { 511a88b5ba8SSam Ravnborg return sys_fadvise64_64(fd, 512a88b5ba8SSam Ravnborg (offhi << 32) | offlo, 513a88b5ba8SSam Ravnborg (lenhi << 32) | lenlo, 514a88b5ba8SSam Ravnborg advice); 515a88b5ba8SSam Ravnborg } 516a88b5ba8SSam Ravnborg 517a88b5ba8SSam Ravnborg asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, 518a88b5ba8SSam Ravnborg compat_off_t __user *offset, 519a88b5ba8SSam Ravnborg compat_size_t count) 520a88b5ba8SSam Ravnborg { 521a88b5ba8SSam Ravnborg mm_segment_t old_fs = get_fs(); 522a88b5ba8SSam Ravnborg int ret; 523a88b5ba8SSam Ravnborg off_t of; 524a88b5ba8SSam Ravnborg 525a88b5ba8SSam Ravnborg if (offset && get_user(of, offset)) 526a88b5ba8SSam Ravnborg return -EFAULT; 527a88b5ba8SSam Ravnborg 528a88b5ba8SSam Ravnborg set_fs(KERNEL_DS); 529a88b5ba8SSam Ravnborg ret = sys_sendfile(out_fd, in_fd, 530a88b5ba8SSam Ravnborg offset ? (off_t __user *) &of : NULL, 531a88b5ba8SSam Ravnborg count); 532a88b5ba8SSam Ravnborg set_fs(old_fs); 533a88b5ba8SSam Ravnborg 534a88b5ba8SSam Ravnborg if (offset && put_user(of, offset)) 535a88b5ba8SSam Ravnborg return -EFAULT; 536a88b5ba8SSam Ravnborg 537a88b5ba8SSam Ravnborg return ret; 538a88b5ba8SSam Ravnborg } 539a88b5ba8SSam Ravnborg 540a88b5ba8SSam Ravnborg asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd, 541a88b5ba8SSam Ravnborg compat_loff_t __user *offset, 542a88b5ba8SSam Ravnborg compat_size_t count) 543a88b5ba8SSam Ravnborg { 544a88b5ba8SSam Ravnborg mm_segment_t old_fs = get_fs(); 545a88b5ba8SSam Ravnborg int ret; 546a88b5ba8SSam Ravnborg loff_t lof; 547a88b5ba8SSam Ravnborg 548a88b5ba8SSam Ravnborg if (offset && get_user(lof, offset)) 549a88b5ba8SSam Ravnborg return -EFAULT; 550a88b5ba8SSam Ravnborg 551a88b5ba8SSam Ravnborg set_fs(KERNEL_DS); 552a88b5ba8SSam Ravnborg ret = sys_sendfile64(out_fd, in_fd, 553a88b5ba8SSam Ravnborg offset ? (loff_t __user *) &lof : NULL, 554a88b5ba8SSam Ravnborg count); 555a88b5ba8SSam Ravnborg set_fs(old_fs); 556a88b5ba8SSam Ravnborg 557a88b5ba8SSam Ravnborg if (offset && put_user(lof, offset)) 558a88b5ba8SSam Ravnborg return -EFAULT; 559a88b5ba8SSam Ravnborg 560a88b5ba8SSam Ravnborg return ret; 561a88b5ba8SSam Ravnborg } 562a88b5ba8SSam Ravnborg 563a88b5ba8SSam Ravnborg /* This is just a version for 32-bit applications which does 564a88b5ba8SSam Ravnborg * not force O_LARGEFILE on. 565a88b5ba8SSam Ravnborg */ 566a88b5ba8SSam Ravnborg 567a88b5ba8SSam Ravnborg asmlinkage long sparc32_open(const char __user *filename, 568a88b5ba8SSam Ravnborg int flags, int mode) 569a88b5ba8SSam Ravnborg { 570a88b5ba8SSam Ravnborg return do_sys_open(AT_FDCWD, filename, flags, mode); 571a88b5ba8SSam Ravnborg } 572a88b5ba8SSam Ravnborg 573a88b5ba8SSam Ravnborg extern unsigned long do_mremap(unsigned long addr, 574a88b5ba8SSam Ravnborg unsigned long old_len, unsigned long new_len, 575a88b5ba8SSam Ravnborg unsigned long flags, unsigned long new_addr); 576a88b5ba8SSam Ravnborg 577a88b5ba8SSam Ravnborg asmlinkage unsigned long sys32_mremap(unsigned long addr, 578a88b5ba8SSam Ravnborg unsigned long old_len, unsigned long new_len, 579a88b5ba8SSam Ravnborg unsigned long flags, u32 __new_addr) 580a88b5ba8SSam Ravnborg { 581a88b5ba8SSam Ravnborg unsigned long ret = -EINVAL; 582a88b5ba8SSam Ravnborg unsigned long new_addr = __new_addr; 583a88b5ba8SSam Ravnborg 584a88b5ba8SSam Ravnborg if (unlikely(sparc_mmap_check(addr, old_len))) 585a88b5ba8SSam Ravnborg goto out; 586a88b5ba8SSam Ravnborg if (unlikely(sparc_mmap_check(new_addr, new_len))) 587a88b5ba8SSam Ravnborg goto out; 588a88b5ba8SSam Ravnborg down_write(¤t->mm->mmap_sem); 589a88b5ba8SSam Ravnborg ret = do_mremap(addr, old_len, new_len, flags, new_addr); 590a88b5ba8SSam Ravnborg up_write(¤t->mm->mmap_sem); 591a88b5ba8SSam Ravnborg out: 592a88b5ba8SSam Ravnborg return ret; 593a88b5ba8SSam Ravnborg } 594a88b5ba8SSam Ravnborg 595a88b5ba8SSam Ravnborg struct __sysctl_args32 { 596a88b5ba8SSam Ravnborg u32 name; 597a88b5ba8SSam Ravnborg int nlen; 598a88b5ba8SSam Ravnborg u32 oldval; 599a88b5ba8SSam Ravnborg u32 oldlenp; 600a88b5ba8SSam Ravnborg u32 newval; 601a88b5ba8SSam Ravnborg u32 newlen; 602a88b5ba8SSam Ravnborg u32 __unused[4]; 603a88b5ba8SSam Ravnborg }; 604a88b5ba8SSam Ravnborg 605a88b5ba8SSam Ravnborg asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) 606a88b5ba8SSam Ravnborg { 607a88b5ba8SSam Ravnborg #ifndef CONFIG_SYSCTL_SYSCALL 608a88b5ba8SSam Ravnborg return -ENOSYS; 609a88b5ba8SSam Ravnborg #else 610a88b5ba8SSam Ravnborg struct __sysctl_args32 tmp; 611a88b5ba8SSam Ravnborg int error; 612a88b5ba8SSam Ravnborg size_t oldlen, __user *oldlenp = NULL; 613a88b5ba8SSam Ravnborg unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL; 614a88b5ba8SSam Ravnborg 615a88b5ba8SSam Ravnborg if (copy_from_user(&tmp, args, sizeof(tmp))) 616a88b5ba8SSam Ravnborg return -EFAULT; 617a88b5ba8SSam Ravnborg 618a88b5ba8SSam Ravnborg if (tmp.oldval && tmp.oldlenp) { 619a88b5ba8SSam Ravnborg /* Duh, this is ugly and might not work if sysctl_args 620a88b5ba8SSam Ravnborg is in read-only memory, but do_sysctl does indirectly 621a88b5ba8SSam Ravnborg a lot of uaccess in both directions and we'd have to 622a88b5ba8SSam Ravnborg basically copy the whole sysctl.c here, and 623a88b5ba8SSam Ravnborg glibc's __sysctl uses rw memory for the structure 624a88b5ba8SSam Ravnborg anyway. */ 625a88b5ba8SSam Ravnborg if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) || 626a88b5ba8SSam Ravnborg put_user(oldlen, (size_t __user *)addr)) 627a88b5ba8SSam Ravnborg return -EFAULT; 628a88b5ba8SSam Ravnborg oldlenp = (size_t __user *)addr; 629a88b5ba8SSam Ravnborg } 630a88b5ba8SSam Ravnborg 631a88b5ba8SSam Ravnborg lock_kernel(); 632a88b5ba8SSam Ravnborg error = do_sysctl((int __user *)(unsigned long) tmp.name, 633a88b5ba8SSam Ravnborg tmp.nlen, 634a88b5ba8SSam Ravnborg (void __user *)(unsigned long) tmp.oldval, 635a88b5ba8SSam Ravnborg oldlenp, 636a88b5ba8SSam Ravnborg (void __user *)(unsigned long) tmp.newval, 637a88b5ba8SSam Ravnborg tmp.newlen); 638a88b5ba8SSam Ravnborg unlock_kernel(); 639a88b5ba8SSam Ravnborg if (oldlenp) { 640a88b5ba8SSam Ravnborg if (!error) { 641a88b5ba8SSam Ravnborg if (get_user(oldlen, (size_t __user *)addr) || 642a88b5ba8SSam Ravnborg put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp)) 643a88b5ba8SSam Ravnborg error = -EFAULT; 644a88b5ba8SSam Ravnborg } 645a88b5ba8SSam Ravnborg if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) 646a88b5ba8SSam Ravnborg error = -EFAULT; 647a88b5ba8SSam Ravnborg } 648a88b5ba8SSam Ravnborg return error; 649a88b5ba8SSam Ravnborg #endif 650a88b5ba8SSam Ravnborg } 651a88b5ba8SSam Ravnborg 652a88b5ba8SSam Ravnborg long sys32_lookup_dcookie(unsigned long cookie_high, 653a88b5ba8SSam Ravnborg unsigned long cookie_low, 654a88b5ba8SSam Ravnborg char __user *buf, size_t len) 655a88b5ba8SSam Ravnborg { 656a88b5ba8SSam Ravnborg return sys_lookup_dcookie((cookie_high << 32) | cookie_low, 657a88b5ba8SSam Ravnborg buf, len); 658a88b5ba8SSam Ravnborg } 659a88b5ba8SSam Ravnborg 660a88b5ba8SSam Ravnborg long compat_sync_file_range(int fd, unsigned long off_high, unsigned long off_low, unsigned long nb_high, unsigned long nb_low, int flags) 661a88b5ba8SSam Ravnborg { 662a88b5ba8SSam Ravnborg return sys_sync_file_range(fd, 663a88b5ba8SSam Ravnborg (off_high << 32) | off_low, 664a88b5ba8SSam Ravnborg (nb_high << 32) | nb_low, 665a88b5ba8SSam Ravnborg flags); 666a88b5ba8SSam Ravnborg } 667a88b5ba8SSam Ravnborg 668a88b5ba8SSam Ravnborg asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo, 669a88b5ba8SSam Ravnborg u32 lenhi, u32 lenlo) 670a88b5ba8SSam Ravnborg { 671a88b5ba8SSam Ravnborg return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo, 672a88b5ba8SSam Ravnborg ((loff_t)lenhi << 32) | lenlo); 673a88b5ba8SSam Ravnborg } 674