diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/um/kernel/syscall.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'arch/um/kernel/syscall.c')
-rw-r--r-- | arch/um/kernel/syscall.c | 60 |
1 files changed, 50 insertions, 10 deletions
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index c1d0ae069b5..f958cb876ee 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
@@ -3,16 +3,40 @@ | |||
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <linux/file.h> | 6 | #include "linux/file.h" |
7 | #include <linux/fs.h> | 7 | #include "linux/fs.h" |
8 | #include <linux/mm.h> | 8 | #include "linux/mm.h" |
9 | #include <linux/sched.h> | 9 | #include "linux/sched.h" |
10 | #include <linux/utsname.h> | 10 | #include "linux/utsname.h" |
11 | #include <linux/syscalls.h> | 11 | #include "linux/syscalls.h" |
12 | #include <asm/current.h> | 12 | #include "asm/current.h" |
13 | #include <asm/mman.h> | 13 | #include "asm/mman.h" |
14 | #include <asm/uaccess.h> | 14 | #include "asm/uaccess.h" |
15 | #include <asm/unistd.h> | 15 | #include "asm/unistd.h" |
16 | #include "internal.h" | ||
17 | |||
18 | long sys_fork(void) | ||
19 | { | ||
20 | long ret; | ||
21 | |||
22 | current->thread.forking = 1; | ||
23 | ret = do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), | ||
24 | ¤t->thread.regs, 0, NULL, NULL); | ||
25 | current->thread.forking = 0; | ||
26 | return ret; | ||
27 | } | ||
28 | |||
29 | long sys_vfork(void) | ||
30 | { | ||
31 | long ret; | ||
32 | |||
33 | current->thread.forking = 1; | ||
34 | ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, | ||
35 | UPT_SP(¤t->thread.regs.regs), | ||
36 | ¤t->thread.regs, 0, NULL, NULL); | ||
37 | current->thread.forking = 0; | ||
38 | return ret; | ||
39 | } | ||
16 | 40 | ||
17 | long old_mmap(unsigned long addr, unsigned long len, | 41 | long old_mmap(unsigned long addr, unsigned long len, |
18 | unsigned long prot, unsigned long flags, | 42 | unsigned long prot, unsigned long flags, |
@@ -26,3 +50,19 @@ long old_mmap(unsigned long addr, unsigned long len, | |||
26 | out: | 50 | out: |
27 | return err; | 51 | return err; |
28 | } | 52 | } |
53 | |||
54 | int kernel_execve(const char *filename, | ||
55 | const char *const argv[], | ||
56 | const char *const envp[]) | ||
57 | { | ||
58 | mm_segment_t fs; | ||
59 | int ret; | ||
60 | |||
61 | fs = get_fs(); | ||
62 | set_fs(KERNEL_DS); | ||
63 | ret = um_execve(filename, (const char __user *const __user *)argv, | ||
64 | (const char __user *const __user *) envp); | ||
65 | set_fs(fs); | ||
66 | |||
67 | return ret; | ||
68 | } | ||