| .. | .. |
|---|
| 96 | 96 | |
|---|
| 97 | 97 | static inline void syscall_get_arguments(struct task_struct *task, |
|---|
| 98 | 98 | struct pt_regs *regs, |
|---|
| 99 | | - unsigned int i, unsigned int n, |
|---|
| 100 | 99 | unsigned long *args) |
|---|
| 101 | 100 | { |
|---|
| 102 | 101 | int zero_extend = 0; |
|---|
| 103 | 102 | unsigned int j; |
|---|
| 103 | + unsigned int n = 6; |
|---|
| 104 | 104 | |
|---|
| 105 | 105 | #ifdef CONFIG_SPARC64 |
|---|
| 106 | 106 | if (test_tsk_thread_flag(task, TIF_32BIT)) |
|---|
| .. | .. |
|---|
| 108 | 108 | #endif |
|---|
| 109 | 109 | |
|---|
| 110 | 110 | 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]; |
|---|
| 112 | 112 | |
|---|
| 113 | 113 | if (zero_extend) |
|---|
| 114 | 114 | args[j] = (u32) val; |
|---|
| .. | .. |
|---|
| 119 | 119 | |
|---|
| 120 | 120 | static inline void syscall_set_arguments(struct task_struct *task, |
|---|
| 121 | 121 | struct pt_regs *regs, |
|---|
| 122 | | - unsigned int i, unsigned int n, |
|---|
| 123 | 122 | const unsigned long *args) |
|---|
| 124 | 123 | { |
|---|
| 125 | | - unsigned int j; |
|---|
| 124 | + unsigned int i; |
|---|
| 126 | 125 | |
|---|
| 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]; |
|---|
| 129 | 128 | } |
|---|
| 130 | 129 | |
|---|
| 131 | | -static inline int syscall_get_arch(void) |
|---|
| 130 | +static inline int syscall_get_arch(struct task_struct *task) |
|---|
| 132 | 131 | { |
|---|
| 133 | 132 | #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; |
|---|
| 135 | 135 | #elif defined(CONFIG_SPARC64) |
|---|
| 136 | 136 | return AUDIT_ARCH_SPARC64; |
|---|
| 137 | 137 | #else |
|---|