From 8dea78da5cee153b8af9c07a2745f6c55057fe12 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Thu, 17 Jan 2013 16:15:55 -0500 Subject: Patched in Tegra support. --- arch/um/kernel/syscall.c | 60 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 10 deletions(-) (limited to 'arch/um/kernel/syscall.c') 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 @@ * Licensed under the GPL */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "linux/file.h" +#include "linux/fs.h" +#include "linux/mm.h" +#include "linux/sched.h" +#include "linux/utsname.h" +#include "linux/syscalls.h" +#include "asm/current.h" +#include "asm/mman.h" +#include "asm/uaccess.h" +#include "asm/unistd.h" +#include "internal.h" + +long sys_fork(void) +{ + long ret; + + current->thread.forking = 1; + ret = do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), + ¤t->thread.regs, 0, NULL, NULL); + current->thread.forking = 0; + return ret; +} + +long sys_vfork(void) +{ + long ret; + + current->thread.forking = 1; + ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, + UPT_SP(¤t->thread.regs.regs), + ¤t->thread.regs, 0, NULL, NULL); + current->thread.forking = 0; + return ret; +} long old_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, @@ -26,3 +50,19 @@ long old_mmap(unsigned long addr, unsigned long len, out: return err; } + +int kernel_execve(const char *filename, + const char *const argv[], + const char *const envp[]) +{ + mm_segment_t fs; + int ret; + + fs = get_fs(); + set_fs(KERNEL_DS); + ret = um_execve(filename, (const char __user *const __user *)argv, + (const char __user *const __user *) envp); + set_fs(fs); + + return ret; +} -- cgit v1.2.2