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

MIPS: sysmips: Rewrite to use SYSCALL_DEFINE3().

Thanks to current_pt_regs() there is no need to use the dark MIPS magic.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+5 -12
+5 -12
arch/mips/kernel/syscall.c
··· 138 138 return 0; 139 139 } 140 140 141 - static inline int mips_atomic_set(struct pt_regs *regs, 142 - unsigned long addr, unsigned long new) 141 + static inline int mips_atomic_set(unsigned long addr, unsigned long new) 143 142 { 144 143 unsigned long old, tmp; 144 + struct pt_regs *regs; 145 145 unsigned int err; 146 146 147 147 if (unlikely(addr & 3)) ··· 222 222 if (unlikely(err)) 223 223 return err; 224 224 225 + regs = current_pt_regs(); 225 226 regs->regs[2] = old; 226 227 regs->regs[7] = 0; /* No error */ 227 228 ··· 239 238 unreachable(); 240 239 } 241 240 242 - save_static_function(sys_sysmips); 243 - static int __used noinline 244 - _sys_sysmips(nabi_no_regargs struct pt_regs regs) 241 + SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2) 245 242 { 246 - long cmd, arg1, arg2; 247 - 248 - cmd = regs.regs[4]; 249 - arg1 = regs.regs[5]; 250 - arg2 = regs.regs[6]; 251 - 252 243 switch (cmd) { 253 244 case MIPS_ATOMIC_SET: 254 - return mips_atomic_set(&regs, arg1, arg2); 245 + return mips_atomic_set(arg1, arg2); 255 246 256 247 case MIPS_FIXADE: 257 248 if (arg1 & ~3)