X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fv850%2Fkernel%2Fsyscalls.c;h=d2b1fb19d24313d22896da6d72c710113ddaf9ef;hb=refs%2Fremotes%2Fvserver;hp=9224cb65f6ec8e93e2ccfe084af2144e2d421c26;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/arch/v850/kernel/syscalls.c b/arch/v850/kernel/syscalls.c index 9224cb65f..d2b1fb19d 100644 --- a/arch/v850/kernel/syscalls.c +++ b/arch/v850/kernel/syscalls.c @@ -15,7 +15,6 @@ * and Paul Mackerras (paulus@cs.anu.edu.au). */ -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include /* * sys_ipc() is the de-multiplexer for the SysV IPC calls.. @@ -195,3 +195,22 @@ unsigned long sys_mmap (unsigned long addr, size_t len, out: return err; } + +/* + * 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[]) +{ + register char *__a __asm__ ("r6") = filename; + register void *__b __asm__ ("r7") = argv; + register void *__c __asm__ ("r8") = envp; + register unsigned long __syscall __asm__ ("r12") = __NR_execve; + register unsigned long __ret __asm__ ("r10"); + __asm__ __volatile__ ("trap 0" + : "=r" (__ret), "=r" (__syscall) + : "1" (__syscall), "r" (__a), "r" (__b), "r" (__c) + : "r1", "r5", "r11", "r13", "r14", + "r15", "r16", "r17", "r18", "r19"); + return __ret; +}