Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'asm-generic-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic cleanup from Arnd Bergmann:
"This is a single cleanup from Peter Collingbourne, removing some dead
code"

* tag 'asm-generic-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
arch: remove unused function syscall_set_arguments()

+14 -263
-10
arch/arm/include/asm/syscall.h
··· 77 77 memcpy(args, &regs->ARM_r0 + 1, 5 * sizeof(args[0])); 78 78 } 79 79 80 - static inline void syscall_set_arguments(struct task_struct *task, 81 - struct pt_regs *regs, 82 - const unsigned long *args) 83 - { 84 - regs->ARM_ORIG_r0 = args[0]; 85 - args++; 86 - 87 - memcpy(&regs->ARM_r0 + 1, args, 5 * sizeof(args[0])); 88 - } 89 - 90 80 static inline int syscall_get_arch(struct task_struct *task) 91 81 { 92 82 /* ARM tasks don't change audit architectures on the fly. */
-10
arch/arm64/include/asm/syscall.h
··· 73 73 memcpy(args, &regs->regs[1], 5 * sizeof(args[0])); 74 74 } 75 75 76 - static inline void syscall_set_arguments(struct task_struct *task, 77 - struct pt_regs *regs, 78 - const unsigned long *args) 79 - { 80 - regs->orig_x0 = args[0]; 81 - args++; 82 - 83 - memcpy(&regs->regs[1], args, 5 * sizeof(args[0])); 84 - } 85 - 86 76 /* 87 77 * We don't care about endianness (__AUDIT_ARCH_LE bit) here because 88 78 * AArch64 has the same system calls both on little- and big- endian.
-9
arch/csky/include/asm/syscall.h
··· 59 59 memcpy(args, &regs->a1, 5 * sizeof(args[0])); 60 60 } 61 61 62 - static inline void 63 - syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, 64 - const unsigned long *args) 65 - { 66 - regs->orig_a0 = args[0]; 67 - args++; 68 - memcpy(&regs->a1, args, 5 * sizeof(regs->a1)); 69 - } 70 - 71 62 static inline int 72 63 syscall_get_arch(struct task_struct *task) 73 64 {
+2 -15
arch/ia64/include/asm/syscall.h
··· 55 55 } 56 56 } 57 57 58 - extern void ia64_syscall_get_set_arguments(struct task_struct *task, 59 - struct pt_regs *regs, unsigned long *args, int rw); 60 - static inline void syscall_get_arguments(struct task_struct *task, 61 - struct pt_regs *regs, 62 - unsigned long *args) 63 - { 64 - ia64_syscall_get_set_arguments(task, regs, args, 0); 65 - } 66 - 67 - static inline void syscall_set_arguments(struct task_struct *task, 68 - struct pt_regs *regs, 69 - unsigned long *args) 70 - { 71 - ia64_syscall_get_set_arguments(task, regs, args, 1); 72 - } 58 + extern void syscall_get_arguments(struct task_struct *task, 59 + struct pt_regs *regs, unsigned long *args); 73 60 74 61 static inline int syscall_get_arch(struct task_struct *task) 75 62 {
+12 -19
arch/ia64/kernel/ptrace.c
··· 2001 2001 return &user_ia64_view; 2002 2002 } 2003 2003 2004 - struct syscall_get_set_args { 2004 + struct syscall_get_args { 2005 2005 unsigned int i; 2006 2006 unsigned int n; 2007 2007 unsigned long *args; 2008 2008 struct pt_regs *regs; 2009 - int rw; 2010 2009 }; 2011 2010 2012 - static void syscall_get_set_args_cb(struct unw_frame_info *info, void *data) 2011 + static void syscall_get_args_cb(struct unw_frame_info *info, void *data) 2013 2012 { 2014 - struct syscall_get_set_args *args = data; 2013 + struct syscall_get_args *args = data; 2015 2014 struct pt_regs *pt = args->regs; 2016 2015 unsigned long *krbs, cfm, ndirty, nlocals, nouts; 2017 2016 int i, count; ··· 2041 2042 /* Iterate over outs. */ 2042 2043 for (i = 0; i < count; i++) { 2043 2044 int j = ndirty + nlocals + i + args->i; 2044 - if (args->rw) 2045 - *ia64_rse_skip_regs(krbs, j) = args->args[i]; 2046 - else 2047 - args->args[i] = *ia64_rse_skip_regs(krbs, j); 2045 + args->args[i] = *ia64_rse_skip_regs(krbs, j); 2048 2046 } 2049 2047 2050 - if (!args->rw) { 2051 - while (i < args->n) { 2052 - args->args[i] = 0; 2053 - i++; 2054 - } 2048 + while (i < args->n) { 2049 + args->args[i] = 0; 2050 + i++; 2055 2051 } 2056 2052 } 2057 2053 2058 - void ia64_syscall_get_set_arguments(struct task_struct *task, 2059 - struct pt_regs *regs, unsigned long *args, int rw) 2054 + void syscall_get_arguments(struct task_struct *task, 2055 + struct pt_regs *regs, unsigned long *args) 2060 2056 { 2061 - struct syscall_get_set_args data = { 2057 + struct syscall_get_args data = { 2062 2058 .i = 0, 2063 2059 .n = 6, 2064 2060 .args = args, 2065 2061 .regs = regs, 2066 - .rw = rw, 2067 2062 }; 2068 2063 2069 2064 if (task == current) 2070 - unw_init_running(syscall_get_set_args_cb, &data); 2065 + unw_init_running(syscall_get_args_cb, &data); 2071 2066 else { 2072 2067 struct unw_frame_info ufi; 2073 2068 memset(&ufi, 0, sizeof(ufi)); 2074 2069 unw_init_from_blocked_task(&ufi, task); 2075 - syscall_get_set_args_cb(&ufi, &data); 2070 + syscall_get_args_cb(&ufi, &data); 2076 2071 } 2077 2072 }
-33
arch/microblaze/include/asm/syscall.h
··· 58 58 return ~0; 59 59 } 60 60 61 - static inline void microblaze_set_syscall_arg(struct pt_regs *regs, 62 - unsigned int n, 63 - unsigned long val) 64 - { 65 - switch (n) { 66 - case 5: 67 - regs->r10 = val; 68 - case 4: 69 - regs->r9 = val; 70 - case 3: 71 - regs->r8 = val; 72 - case 2: 73 - regs->r7 = val; 74 - case 1: 75 - regs->r6 = val; 76 - case 0: 77 - regs->r5 = val; 78 - default: 79 - BUG(); 80 - } 81 - } 82 - 83 61 static inline void syscall_get_arguments(struct task_struct *task, 84 62 struct pt_regs *regs, 85 63 unsigned long *args) ··· 67 89 68 90 while (n--) 69 91 *args++ = microblaze_get_syscall_arg(regs, i++); 70 - } 71 - 72 - static inline void syscall_set_arguments(struct task_struct *task, 73 - struct pt_regs *regs, 74 - const unsigned long *args) 75 - { 76 - unsigned int i = 0; 77 - unsigned int n = 6; 78 - 79 - while (n--) 80 - microblaze_set_syscall_arg(regs, i++, *args++); 81 92 } 82 93 83 94 asmlinkage unsigned long do_syscall_trace_enter(struct pt_regs *regs);
-22
arch/nds32/include/asm/syscall.h
··· 132 132 memcpy(args, &regs->uregs[0] + 1, 5 * sizeof(args[0])); 133 133 } 134 134 135 - /** 136 - * syscall_set_arguments - change system call parameter value 137 - * @task: task of interest, must be in system call entry tracing 138 - * @regs: task_pt_regs() of @task 139 - * @args: array of argument values to store 140 - * 141 - * Changes 6 arguments to the system call. The first argument gets value 142 - * @args[0], and so on. 143 - * 144 - * It's only valid to call this when @task is stopped for tracing on 145 - * entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT. 146 - */ 147 - static inline void 148 - syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, 149 - const unsigned long *args) 150 - { 151 - regs->orig_r0 = args[0]; 152 - args++; 153 - 154 - memcpy(&regs->uregs[0] + 1, args, 5 * sizeof(args[0])); 155 - } 156 - 157 135 static inline int 158 136 syscall_get_arch(struct task_struct *task) 159 137 {
-11
arch/nios2/include/asm/syscall.h
··· 58 58 *args = regs->r9; 59 59 } 60 60 61 - static inline void syscall_set_arguments(struct task_struct *task, 62 - struct pt_regs *regs, const unsigned long *args) 63 - { 64 - regs->r4 = *args++; 65 - regs->r5 = *args++; 66 - regs->r6 = *args++; 67 - regs->r7 = *args++; 68 - regs->r8 = *args++; 69 - regs->r9 = *args; 70 - } 71 - 72 61 static inline int syscall_get_arch(struct task_struct *task) 73 62 { 74 63 return AUDIT_ARCH_NIOS2;
-7
arch/openrisc/include/asm/syscall.h
··· 57 57 memcpy(args, &regs->gpr[3], 6 * sizeof(args[0])); 58 58 } 59 59 60 - static inline void 61 - syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, 62 - const unsigned long *args) 63 - { 64 - memcpy(&regs->gpr[3], args, 6 * sizeof(args[0])); 65 - } 66 - 67 60 static inline int syscall_get_arch(struct task_struct *task) 68 61 { 69 62 return AUDIT_ARCH_OPENRISC;
-10
arch/powerpc/include/asm/syscall.h
··· 103 103 } 104 104 } 105 105 106 - static inline void syscall_set_arguments(struct task_struct *task, 107 - struct pt_regs *regs, 108 - const unsigned long *args) 109 - { 110 - memcpy(&regs->gpr[3], args, 6 * sizeof(args[0])); 111 - 112 - /* Also copy the first argument into orig_gpr3 */ 113 - regs->orig_gpr3 = args[0]; 114 - } 115 - 116 106 static inline int syscall_get_arch(struct task_struct *task) 117 107 { 118 108 if (is_32bit_task())
-9
arch/riscv/include/asm/syscall.h
··· 64 64 memcpy(args, &regs->a1, 5 * sizeof(args[0])); 65 65 } 66 66 67 - static inline void syscall_set_arguments(struct task_struct *task, 68 - struct pt_regs *regs, 69 - const unsigned long *args) 70 - { 71 - regs->orig_a0 = args[0]; 72 - args++; 73 - memcpy(&regs->a1, args, 5 * sizeof(regs->a1)); 74 - } 75 - 76 67 static inline int syscall_get_arch(struct task_struct *task) 77 68 { 78 69 #ifdef CONFIG_64BIT
-12
arch/s390/include/asm/syscall.h
··· 78 78 args[0] = regs->orig_gpr2 & mask; 79 79 } 80 80 81 - static inline void syscall_set_arguments(struct task_struct *task, 82 - struct pt_regs *regs, 83 - const unsigned long *args) 84 - { 85 - unsigned int n = 6; 86 - 87 - while (n-- > 0) 88 - if (n > 0) 89 - regs->gprs[2 + n] = args[n]; 90 - regs->orig_gpr2 = args[0]; 91 - } 92 - 93 81 static inline int syscall_get_arch(struct task_struct *task) 94 82 { 95 83 #ifdef CONFIG_COMPAT
-12
arch/sh/include/asm/syscall_32.h
··· 57 57 args[0] = regs->regs[4]; 58 58 } 59 59 60 - static inline void syscall_set_arguments(struct task_struct *task, 61 - struct pt_regs *regs, 62 - const unsigned long *args) 63 - { 64 - regs->regs[1] = args[5]; 65 - regs->regs[0] = args[4]; 66 - regs->regs[7] = args[3]; 67 - regs->regs[6] = args[2]; 68 - regs->regs[5] = args[1]; 69 - regs->regs[4] = args[0]; 70 - } 71 - 72 60 static inline int syscall_get_arch(struct task_struct *task) 73 61 { 74 62 int arch = AUDIT_ARCH_SH;
-10
arch/sparc/include/asm/syscall.h
··· 117 117 } 118 118 } 119 119 120 - static inline void syscall_set_arguments(struct task_struct *task, 121 - struct pt_regs *regs, 122 - const unsigned long *args) 123 - { 124 - unsigned int i; 125 - 126 - for (i = 0; i < 6; i++) 127 - regs->u_regs[UREG_I0 + i] = args[i]; 128 - } 129 - 130 120 static inline int syscall_get_arch(struct task_struct *task) 131 121 { 132 122 #if defined(CONFIG_SPARC64) && defined(CONFIG_COMPAT)
-14
arch/um/include/asm/syscall-generic.h
··· 62 62 *args = UPT_SYSCALL_ARG6(r); 63 63 } 64 64 65 - static inline void syscall_set_arguments(struct task_struct *task, 66 - struct pt_regs *regs, 67 - const unsigned long *args) 68 - { 69 - struct uml_pt_regs *r = &regs->regs; 70 - 71 - UPT_SYSCALL_ARG1(r) = *args++; 72 - UPT_SYSCALL_ARG2(r) = *args++; 73 - UPT_SYSCALL_ARG3(r) = *args++; 74 - UPT_SYSCALL_ARG4(r) = *args++; 75 - UPT_SYSCALL_ARG5(r) = *args++; 76 - UPT_SYSCALL_ARG6(r) = *args; 77 - } 78 - 79 65 /* See arch/x86/um/asm/syscall.h for syscall_get_arch() definition. */ 80 66 81 67 #endif /* __UM_SYSCALL_GENERIC_H */
-33
arch/x86/include/asm/syscall.h
··· 87 87 memcpy(args, &regs->bx, 6 * sizeof(args[0])); 88 88 } 89 89 90 - static inline void syscall_set_arguments(struct task_struct *task, 91 - struct pt_regs *regs, 92 - unsigned int i, unsigned int n, 93 - const unsigned long *args) 94 - { 95 - BUG_ON(i + n > 6); 96 - memcpy(&regs->bx + i, args, n * sizeof(args[0])); 97 - } 98 - 99 90 static inline int syscall_get_arch(struct task_struct *task) 100 91 { 101 92 return AUDIT_ARCH_I386; ··· 115 124 *args++ = regs->r10; 116 125 *args++ = regs->r8; 117 126 *args = regs->r9; 118 - } 119 - } 120 - 121 - static inline void syscall_set_arguments(struct task_struct *task, 122 - struct pt_regs *regs, 123 - const unsigned long *args) 124 - { 125 - # ifdef CONFIG_IA32_EMULATION 126 - if (task->thread_info.status & TS_COMPAT) { 127 - regs->bx = *args++; 128 - regs->cx = *args++; 129 - regs->dx = *args++; 130 - regs->si = *args++; 131 - regs->di = *args++; 132 - regs->bp = *args; 133 - } else 134 - # endif 135 - { 136 - regs->di = *args++; 137 - regs->si = *args++; 138 - regs->dx = *args++; 139 - regs->r10 = *args++; 140 - regs->r8 = *args++; 141 - regs->r9 = *args; 142 127 } 143 128 } 144 129
-11
arch/xtensa/include/asm/syscall.h
··· 68 68 args[i] = regs->areg[reg[i]]; 69 69 } 70 70 71 - static inline void syscall_set_arguments(struct task_struct *task, 72 - struct pt_regs *regs, 73 - const unsigned long *args) 74 - { 75 - static const unsigned int reg[] = XTENSA_SYSCALL_ARGUMENT_REGS; 76 - unsigned int i; 77 - 78 - for (i = 0; i < 6; ++i) 79 - regs->areg[reg[i]] = args[i]; 80 - } 81 - 82 71 asmlinkage long xtensa_rt_sigreturn(void); 83 72 asmlinkage long xtensa_shmat(int, char __user *, int); 84 73 asmlinkage long xtensa_fadvise64_64(int, int,
-16
include/asm-generic/syscall.h
··· 118 118 unsigned long *args); 119 119 120 120 /** 121 - * syscall_set_arguments - change system call parameter value 122 - * @task: task of interest, must be in system call entry tracing 123 - * @regs: task_pt_regs() of @task 124 - * @args: array of argument values to store 125 - * 126 - * Changes 6 arguments to the system call. 127 - * The first argument gets value @args[0], and so on. 128 - * 129 - * It's only valid to call this when @task is stopped for tracing on 130 - * entry to a system call, due to %SYSCALL_WORK_SYSCALL_TRACE or 131 - * %SYSCALL_WORK_SYSCALL_AUDIT. 132 - */ 133 - void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, 134 - const unsigned long *args); 135 - 136 - /** 137 121 * syscall_get_arch - return the AUDIT_ARCH for the current system call 138 122 * @task: task of interest, must be blocked 139 123 *