Adding support for MOXA ART SoC. Testing port of linux-2.6.32.60-moxart.
[linux-3.6.7-moxart.git] / arch / um / kernel / syscall.c
bloba4c6d8eee74c702999cc26955e250f40db30f553
1 /*
2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
6 #include "linux/file.h"
7 #include "linux/fs.h"
8 #include "linux/mm.h"
9 #include "linux/sched.h"
10 #include "linux/utsname.h"
11 #include "linux/syscalls.h"
12 #include "asm/current.h"
13 #include "asm/mman.h"
14 #include "asm/uaccess.h"
15 #include "asm/unistd.h"
16 #include "internal.h"
18 long sys_fork(void)
20 return do_fork(SIGCHLD, UPT_SP(&current->thread.regs.regs),
21 &current->thread.regs, 0, NULL, NULL);
24 long sys_vfork(void)
26 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
27 UPT_SP(&current->thread.regs.regs),
28 &current->thread.regs, 0, NULL, NULL);
31 long sys_clone(unsigned long clone_flags, unsigned long newsp,
32 void __user *parent_tid, void __user *child_tid)
34 if (!newsp)
35 newsp = UPT_SP(&current->thread.regs.regs);
37 return do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid,
38 child_tid);
41 long old_mmap(unsigned long addr, unsigned long len,
42 unsigned long prot, unsigned long flags,
43 unsigned long fd, unsigned long offset)
45 long err = -EINVAL;
46 if (offset & ~PAGE_MASK)
47 goto out;
49 err = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
50 out:
51 return err;
54 int kernel_execve(const char *filename,
55 const char *const argv[],
56 const char *const envp[])
58 mm_segment_t fs;
59 int ret;
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);
67 return ret;