Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * These routines maintain argument size conversion between 32bit and 64bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * environment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/capability.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/fs.h> 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/mm.h> 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/file.h> 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/signal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/resource.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/times.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/smp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/sem.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/msg.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/shm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/uio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/quota.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <linux/poll.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <linux/personality.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <linux/stat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include <linux/filter.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include <linux/highmem.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include <linux/highuid.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include <linux/mman.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #include <linux/ipv6.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include <linux/in.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include <linux/icmpv6.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #include <linux/syscalls.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #include <linux/sysctl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #include <linux/binfmts.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #include <linux/dnotify.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #include <linux/security.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #include <linux/compat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #include <linux/vfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #include <linux/ptrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #include <asm/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #include <linux/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #include <asm/fpumacro.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #include <asm/mmu_context.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #include <asm/compat_signal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #include "systbls.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) COMPAT_SYSCALL_DEFINE3(truncate64, const char __user *, path, u32, high, u32, low)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	return ksys_truncate(path, ((u64)high << 32) | low);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) COMPAT_SYSCALL_DEFINE3(ftruncate64, unsigned int, fd, u32, high, u32, low)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	return ksys_ftruncate(fd, ((u64)high << 32) | low);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) static int cp_compat_stat64(struct kstat *stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			    struct compat_stat64 __user *statbuf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	err  = put_user(huge_encode_dev(stat->dev), &statbuf->st_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	err |= put_user(stat->ino, &statbuf->st_ino);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	err |= put_user(stat->mode, &statbuf->st_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	err |= put_user(stat->nlink, &statbuf->st_nlink);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	err |= put_user(from_kuid_munged(current_user_ns(), stat->uid), &statbuf->st_uid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	err |= put_user(from_kgid_munged(current_user_ns(), stat->gid), &statbuf->st_gid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	err |= put_user(huge_encode_dev(stat->rdev), &statbuf->st_rdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	err |= put_user(0, (unsigned long __user *) &statbuf->__pad3[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	err |= put_user(stat->size, &statbuf->st_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	err |= put_user(stat->blksize, &statbuf->st_blksize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	err |= put_user(0, (unsigned int __user *) &statbuf->__pad4[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	err |= put_user(0, (unsigned int __user *) &statbuf->__pad4[4]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	err |= put_user(stat->blocks, &statbuf->st_blocks);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	err |= put_user(stat->atime.tv_sec, &statbuf->st_atime);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	err |= put_user(stat->atime.tv_nsec, &statbuf->st_atime_nsec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	err |= put_user(stat->mtime.tv_sec, &statbuf->st_mtime);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	err |= put_user(stat->mtime.tv_nsec, &statbuf->st_mtime_nsec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	err |= put_user(stat->ctime.tv_sec, &statbuf->st_ctime);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	err |= put_user(stat->ctime.tv_nsec, &statbuf->st_ctime_nsec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	err |= put_user(0, &statbuf->__unused4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	err |= put_user(0, &statbuf->__unused5);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) COMPAT_SYSCALL_DEFINE2(stat64, const char __user *, filename,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		struct compat_stat64 __user *, statbuf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	struct kstat stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	int error = vfs_stat(filename, &stat);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	if (!error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		error = cp_compat_stat64(&stat, statbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) COMPAT_SYSCALL_DEFINE2(lstat64, const char __user *, filename,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		struct compat_stat64 __user *, statbuf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	struct kstat stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	int error = vfs_lstat(filename, &stat);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	if (!error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		error = cp_compat_stat64(&stat, statbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) COMPAT_SYSCALL_DEFINE2(fstat64, unsigned int, fd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		struct compat_stat64 __user *, statbuf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	struct kstat stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	int error = vfs_fstat(fd, &stat);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	if (!error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		error = cp_compat_stat64(&stat, statbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) COMPAT_SYSCALL_DEFINE4(fstatat64, unsigned int, dfd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		const char __user *, filename,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		struct compat_stat64 __user *, statbuf, int, flag)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	struct kstat stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	int error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	error = vfs_fstatat(dfd, filename, &stat, flag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	return cp_compat_stat64(&stat, statbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) COMPAT_SYSCALL_DEFINE3(sparc_sigaction, int, sig,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 			struct compat_old_sigaction __user *,act,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 			struct compat_old_sigaction __user *,oact)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	WARN_ON_ONCE(sig >= 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	return compat_sys_sigaction(-sig, act, oact);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) COMPAT_SYSCALL_DEFINE5(rt_sigaction, int, sig,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			struct compat_sigaction __user *,act,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 			struct compat_sigaction __user *,oact,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 			void __user *,restorer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 			compat_size_t,sigsetsize)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)         struct k_sigaction new_ka, old_ka;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)         int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)         /* XXX: Don't preclude handling different sized sigset_t's.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)         if (sigsetsize != sizeof(compat_sigset_t))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)                 return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)         if (act) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		u32 u_handler, u_restorer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		new_ka.ka_restorer = restorer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		ret = get_user(u_handler, &act->sa_handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		new_ka.sa.sa_handler =  compat_ptr(u_handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		ret |= get_compat_sigset(&new_ka.sa.sa_mask, &act->sa_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		ret |= get_user(u_restorer, &act->sa_restorer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 		new_ka.sa.sa_restorer = compat_ptr(u_restorer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)                 if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)                 	return -EFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	if (!ret && oact) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		ret |= put_compat_sigset(&oact->sa_mask, &old_ka.sa.sa_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 					 sizeof(oact->sa_mask));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		ret |= put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 			ret = -EFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)         }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)         return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) COMPAT_SYSCALL_DEFINE5(pread64, unsigned int, fd, char __user *, ubuf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 			compat_size_t, count, u32, poshi, u32, poslo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	return ksys_pread64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) COMPAT_SYSCALL_DEFINE5(pwrite64, unsigned int, fd, char __user *, ubuf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 			compat_size_t, count, u32, poshi, u32, poslo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	return ksys_pwrite64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) COMPAT_SYSCALL_DEFINE4(readahead, int, fd, u32, offhi, u32, offlo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		     compat_size_t, count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	return ksys_readahead(fd, ((u64)offhi << 32) | offlo, count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) COMPAT_SYSCALL_DEFINE5(fadvise64, int, fd, u32, offhi, u32, offlo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 			  compat_size_t, len, int, advice)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	return ksys_fadvise64_64(fd, ((u64)offhi << 32) | offlo, len, advice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) COMPAT_SYSCALL_DEFINE6(fadvise64_64, int, fd, u32, offhi, u32, offlo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			     u32, lenhi, u32, lenlo, int, advice)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	return ksys_fadvise64_64(fd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 				 ((u64)offhi << 32) | offlo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 				 ((u64)lenhi << 32) | lenlo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 				 advice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) COMPAT_SYSCALL_DEFINE6(sync_file_range, unsigned int, fd, u32, off_high, u32, off_low,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			u32, nb_high, u32, nb_low, unsigned int, flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	return ksys_sync_file_range(fd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 				    ((u64)off_high << 32) | off_low,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 				    ((u64)nb_high << 32) | nb_low,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 				    flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, u32, offhi, u32, offlo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 				     u32, lenhi, u32, lenlo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	return ksys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 			      ((loff_t)lenhi << 32) | lenlo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) }