10 #include <linux/capability.h>
11 #include <linux/errno.h>
12 #include <linux/linkage.h>
15 #include <linux/ptrace.h>
16 #include <linux/string.h>
19 #include <linux/utsname.h>
21 #include <linux/sem.h>
22 #include <linux/msg.h>
23 #include <linux/shm.h>
24 #include <linux/compiler.h>
25 #include <linux/ipc.h>
27 #include <linux/slab.h>
28 #include <linux/elf.h>
32 #include <asm/cachectl.h>
33 #include <asm/cacheflush.h>
34 #include <asm/asm-offsets.h>
35 #include <asm/signal.h>
37 #include <asm/shmparam.h>
39 #include <asm/uaccess.h>
40 #include <asm/switch_to.h>
66 unsigned long, prot,
unsigned long,
flags,
unsigned long,
82 unsigned long, prot,
unsigned long,
flags,
unsigned long,
fd,
102 unsigned long clone_flags;
104 int __user *parent_tidptr, *child_tidptr;
106 clone_flags = regs.regs[4];
107 newsp = regs.regs[5];
109 newsp = regs.regs[29];
110 parent_tidptr = (
int __user *) regs.regs[6];
117 if (
get_user (child_tidptr, &usp[5]))
120 else if (
get_user (child_tidptr, &usp[4]))
124 child_tidptr = (
int __user *) regs.regs[8];
126 return do_fork(clone_flags, newsp, ®s, 0,
127 parent_tidptr, child_tidptr);
138 filename =
getname((
const char __user *) (
long)regs.regs[4]);
139 error = PTR_ERR(filename);
140 if (IS_ERR(filename))
163 static inline int mips_atomic_set(
struct pt_regs *regs,
164 unsigned long addr,
unsigned long new)
166 unsigned long old,
tmp;
179 "1: ll %[old], (%[addr]) \n"
180 " move %[tmp], %[new] \n"
181 "2: sc %[tmp], (%[addr]) \n"
182 " beqzl %[tmp], 1b \n"
184 " .section .fixup,\"ax\" \n"
185 "4: li %[err], %[efault] \n"
188 " .section __ex_table,\"a\" \n"
204 "1: ll %[old], (%[addr]) \n"
205 " move %[tmp], %[new] \n"
206 "2: sc %[tmp], (%[addr]) \n"
207 " bnez %[tmp], 4f \n"
213 " .section .fixup,\"ax\" \n"
214 "5: li %[err], %[efault] \n"
217 " .section __ex_table,\"a\" \n"
237 err |=
__put_user(
new, (
unsigned int *) addr);
265 _sys_sysmips(nabi_no_regargs
struct pt_regs regs)
275 return mips_atomic_set(®s, arg1, arg2);
282 set_thread_flag(TIF_FIXADE);
284 clear_thread_flag(TIF_FIXADE);
286 set_thread_flag(TIF_LOGADE);
288 clear_thread_flag(TIF_LOGADE);
322 const char *
const argv[],
323 const char *
const envp[])
325 register unsigned long __a0
asm(
"$4") = (
unsigned long)
filename;
326 register unsigned long __a1
asm(
"$5") = (
unsigned long) argv;
327 register unsigned long __a2
asm(
"$6") = (
unsigned long) envp;
328 register unsigned long __a3
asm(
"$7");
333 " li $2, %5 # __NR_execve \n"
337 :
"=&r" (__v0),
"=r" (__a3)
338 :
"r" (__a0),
"r" (__a1),
"r" (__a2),
"i" (
__NR_execve)
339 :
"$2",
"$8",
"$9",
"$10",
"$11",
"$12",
"$13",
"$14",
"$15",
"$24",