hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/sparc/include/asm/syscall.h
....@@ -96,11 +96,11 @@
9696
9797 static inline void syscall_get_arguments(struct task_struct *task,
9898 struct pt_regs *regs,
99
- unsigned int i, unsigned int n,
10099 unsigned long *args)
101100 {
102101 int zero_extend = 0;
103102 unsigned int j;
103
+ unsigned int n = 6;
104104
105105 #ifdef CONFIG_SPARC64
106106 if (test_tsk_thread_flag(task, TIF_32BIT))
....@@ -108,7 +108,7 @@
108108 #endif
109109
110110 for (j = 0; j < n; j++) {
111
- unsigned long val = regs->u_regs[UREG_I0 + i + j];
111
+ unsigned long val = regs->u_regs[UREG_I0 + j];
112112
113113 if (zero_extend)
114114 args[j] = (u32) val;
....@@ -119,19 +119,19 @@
119119
120120 static inline void syscall_set_arguments(struct task_struct *task,
121121 struct pt_regs *regs,
122
- unsigned int i, unsigned int n,
123122 const unsigned long *args)
124123 {
125
- unsigned int j;
124
+ unsigned int i;
126125
127
- for (j = 0; j < n; j++)
128
- regs->u_regs[UREG_I0 + i + j] = args[j];
126
+ for (i = 0; i < 6; i++)
127
+ regs->u_regs[UREG_I0 + i] = args[i];
129128 }
130129
131
-static inline int syscall_get_arch(void)
130
+static inline int syscall_get_arch(struct task_struct *task)
132131 {
133132 #if defined(CONFIG_SPARC64) && defined(CONFIG_COMPAT)
134
- return in_compat_syscall() ? AUDIT_ARCH_SPARC : AUDIT_ARCH_SPARC64;
133
+ return test_tsk_thread_flag(task, TIF_32BIT)
134
+ ? AUDIT_ARCH_SPARC : AUDIT_ARCH_SPARC64;
135135 #elif defined(CONFIG_SPARC64)
136136 return AUDIT_ARCH_SPARC64;
137137 #else