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) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2)  * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * License.  See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (C) 1995, 1996, 1997, 2000, 2001, 05 by Ralf Baechle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * Copyright (C) 2001 MIPS Technologies, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/capability.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/linkage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/smp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/ptrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/syscalls.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/utsname.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/unistd.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/compiler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/ipc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <linux/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <linux/elf.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include <linux/sched/task_stack.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include <asm/asm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include <asm/asm-eva.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #include <asm/branch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include <asm/cachectl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include <asm/cacheflush.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #include <asm/asm-offsets.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #include <asm/signal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #include <asm/sim.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #include <asm/shmparam.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #include <asm/sync.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #include <asm/sysmips.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #include <asm/switch_to.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  * For historic reasons the pipe(2) syscall on MIPS has an unusual calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  * convention.	It returns results in registers $v0 / $v1 which means there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  * is no need for it to do verify the validity of a userspace pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  * argument.  Historically that used to be expensive in Linux.	These days
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  * the performance advantage is negligible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) asmlinkage int sysm_pipe(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	int fd[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	int error = do_pipe_flags(fd, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	current_pt_regs()->regs[3] = fd[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	return fd[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	unsigned long, prot, unsigned long, flags, unsigned long,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	fd, off_t, offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	if (offset & ~PAGE_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	return ksys_mmap_pgoff(addr, len, prot, flags, fd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			       offset >> PAGE_SHIFT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	unsigned long, prot, unsigned long, flags, unsigned long, fd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	unsigned long, pgoff)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	if (pgoff & (~PAGE_MASK >> 12))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	return ksys_mmap_pgoff(addr, len, prot, flags, fd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 			       pgoff >> (PAGE_SHIFT - 12));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) save_static_function(sys_fork);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) save_static_function(sys_clone);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) save_static_function(sys_clone3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	struct thread_info *ti = task_thread_info(current);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	ti->tp_value = addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	if (cpu_has_userlocal)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		write_c0_userlocal(addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) static inline int mips_atomic_set(unsigned long addr, unsigned long new)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	unsigned long old, tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	struct pt_regs *regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	unsigned int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	if (unlikely(addr & 3))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	if (unlikely(!access_ok((const void __user *)addr, 4)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	if (cpu_has_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		__asm__ __volatile__ (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		"	.set	push					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		"	.set	arch=r4000				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		"	li	%[err], 0				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		"1:	ll	%[old], (%[addr])			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		"	move	%[tmp], %[new]				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		"2:	sc	%[tmp], (%[addr])			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		"	beqzl	%[tmp], 1b				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		"3:							\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		"	.insn						\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		"	.section .fixup,\"ax\"				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		"4:	li	%[err], %[efault]			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		"	j	3b					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		"	.previous					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		"	.section __ex_table,\"a\"			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		"	"STR(PTR)"	1b, 4b				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		"	"STR(PTR)"	2b, 4b				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		"	.previous					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		"	.set	pop					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		: [old] "=&r" (old),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		  [err] "=&r" (err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		  [tmp] "=&r" (tmp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		: [addr] "r" (addr),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		  [new] "r" (new),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		  [efault] "i" (-EFAULT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		: "memory");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	} else if (cpu_has_llsc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		__asm__ __volatile__ (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		"	.set	push					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		"	.set	"MIPS_ISA_ARCH_LEVEL"			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		"	li	%[err], 0				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		"1:							\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		"	" __SYNC(full, loongson3_war) "			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		user_ll("%[old]", "(%[addr])")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		"	move	%[tmp], %[new]				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		"2:							\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		user_sc("%[tmp]", "(%[addr])")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		"	beqz	%[tmp], 1b				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		"3:							\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		"	.insn						\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		"	.section .fixup,\"ax\"				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		"5:	li	%[err], %[efault]			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		"	j	3b					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		"	.previous					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		"	.section __ex_table,\"a\"			\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		"	"STR(PTR)"	1b, 5b				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		"	"STR(PTR)"	2b, 5b				\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		"	.previous					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		"	.set	pop					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		: [old] "=&r" (old),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		  [err] "=&r" (err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		  [tmp] "=&r" (tmp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		: [addr] "r" (addr),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		  [new] "r" (new),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		  [efault] "i" (-EFAULT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		: "memory");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 			preempt_disable();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 			ll_bit = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 			ll_task = current;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 			preempt_enable();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 			err = __get_user(old, (unsigned int *) addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 			err |= __put_user(new, (unsigned int *) addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 			if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 			rmb();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		} while (!ll_bit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	if (unlikely(err))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	regs = current_pt_regs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	regs->regs[2] = old;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	regs->regs[7] = 0;	/* No error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	 * Don't let your children do this ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	__asm__ __volatile__(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	"	move	$29, %0						\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	"	j	syscall_exit					\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	: /* no outputs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	: "r" (regs));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	/* unreached.  Honestly.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	unreachable();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) }
^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)  * mips_atomic_set() normally returns directly via syscall_exit potentially
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)  * clobbering static registers, so be sure to preserve them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) save_static_function(sys_sysmips);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	switch (cmd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	case MIPS_ATOMIC_SET:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		return mips_atomic_set(arg1, arg2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	case MIPS_FIXADE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		if (arg1 & ~3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		if (arg1 & 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 			set_thread_flag(TIF_FIXADE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 			clear_thread_flag(TIF_FIXADE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		if (arg1 & 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 			set_thread_flag(TIF_LOGADE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			clear_thread_flag(TIF_LOGADE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	case FLUSH_CACHE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 		__flush_cache_all();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)  * No implemented yet ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	return -ENOSYS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) }