Commit bc4f2975 authored by Ralf Baechle's avatar Ralf Baechle

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: default avatarRalf Baechle <ralf@linux-mips.org>
parent 33722a2e
...@@ -138,10 +138,10 @@ SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) ...@@ -138,10 +138,10 @@ SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
return 0; return 0;
} }
static inline int mips_atomic_set(struct pt_regs *regs, static inline int mips_atomic_set(unsigned long addr, unsigned long new)
unsigned long addr, unsigned long new)
{ {
unsigned long old, tmp; unsigned long old, tmp;
struct pt_regs *regs;
unsigned int err; unsigned int err;
if (unlikely(addr & 3)) if (unlikely(addr & 3))
...@@ -222,6 +222,7 @@ static inline int mips_atomic_set(struct pt_regs *regs, ...@@ -222,6 +222,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
if (unlikely(err)) if (unlikely(err))
return err; return err;
regs = current_pt_regs();
regs->regs[2] = old; regs->regs[2] = old;
regs->regs[7] = 0; /* No error */ regs->regs[7] = 0; /* No error */
...@@ -238,19 +239,11 @@ static inline int mips_atomic_set(struct pt_regs *regs, ...@@ -238,19 +239,11 @@ static inline int mips_atomic_set(struct pt_regs *regs,
unreachable(); unreachable();
} }
save_static_function(sys_sysmips); SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2)
static int __used noinline
_sys_sysmips(nabi_no_regargs struct pt_regs regs)
{ {
long cmd, arg1, arg2;
cmd = regs.regs[4];
arg1 = regs.regs[5];
arg2 = regs.regs[6];
switch (cmd) { switch (cmd) {
case MIPS_ATOMIC_SET: case MIPS_ATOMIC_SET:
return mips_atomic_set(&regs, arg1, arg2); return mips_atomic_set(arg1, arg2);
case MIPS_FIXADE: case MIPS_FIXADE:
if (arg1 & ~3) if (arg1 & ~3)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment