X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=arch%2Fxtensa%2Fkernel%2Fsyscalls.c;h=f49cb239e60394e13b6ebf6c512d7f7128295c85;hb=f30c2269544bffc7bf1b0d7c0abe5be1be83b8cb;hp=3540d8b119f39fee1d79c1df0751e96cfdcb9aad;hpb=cc14cf46da215a9df1c0a4388763a68769ef9e53;p=pandora-kernel.git diff --git a/arch/xtensa/kernel/syscalls.c b/arch/xtensa/kernel/syscalls.c index 3540d8b119f3..f49cb239e603 100644 --- a/arch/xtensa/kernel/syscalls.c +++ b/arch/xtensa/kernel/syscalls.c @@ -1,5 +1,5 @@ /* - * arch/xtensa/kernel/syscall.c + * arch/xtensa/kernel/syscalls.c * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -18,7 +18,6 @@ #define DEBUG 0 -#include #include #include #include @@ -42,7 +41,6 @@ #include #include #include -#include extern void do_syscall_trace(void); typedef int (*syscall_t)(void *a0,...); @@ -70,8 +68,8 @@ int sys_pipe(int __user *userfds) /* * Common code for old and new mmaps. */ -long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, - unsigned long flags, unsigned long fd, unsigned long pgoff) +long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, + unsigned long flags, unsigned long fd, unsigned long pgoff) { int error = -EBADF; struct file * file = NULL; @@ -130,7 +128,7 @@ out: int sys_uname(struct old_utsname * name) { - if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) + if (name && !copy_to_user(name, utsname(), sizeof (*name))) return 0; return -EFAULT; } @@ -268,3 +266,23 @@ void system_call (struct pt_regs *regs) regs->areg[2] = res; do_syscall_trace(); } + +/* + * Do a system call from kernel instead of calling sys_execve so we + * end up with proper pt_regs. + */ +int kernel_execve(const char *filename, char *const argv[], char *const envp[]) +{ + long __res; + asm volatile ( + " mov a5, %2 \n" + " mov a4, %4 \n" + " mov a3, %3 \n" + " movi a2, %1 \n" + " syscall \n" + " mov %0, a2 \n" + : "=a" (__res) + : "i" (__NR_execve), "a" (filename), "a" (argv), "a" (envp) + : "a2", "a3", "a4", "a5"); + return __res; +}