diff options
Diffstat (limited to 'arch/h8300/kernel/sys_h8300.c')
-rw-r--r-- | arch/h8300/kernel/sys_h8300.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c index 0f61b7ad69ab..302a2dfe634a 100644 --- a/arch/h8300/kernel/sys_h8300.c +++ b/arch/h8300/kernel/sys_h8300.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <asm/cachectl.h> | 25 | #include <asm/cachectl.h> |
26 | #include <asm/traps.h> | 26 | #include <asm/traps.h> |
27 | #include <asm/ipc.h> | 27 | #include <asm/ipc.h> |
28 | #include <asm/unistd.h> | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * sys_pipe() is the normal C calling standard for creating | 31 | * sys_pipe() is the normal C calling standard for creating |
@@ -280,3 +281,26 @@ asmlinkage void syscall_print(void *dummy,...) | |||
280 | ((regs->pc)&0xffffff)-2,regs->orig_er0,regs->er1,regs->er2,regs->er3,regs->er0); | 281 | ((regs->pc)&0xffffff)-2,regs->orig_er0,regs->er1,regs->er2,regs->er3,regs->er0); |
281 | } | 282 | } |
282 | #endif | 283 | #endif |
284 | |||
285 | /* | ||
286 | * Do a system call from kernel instead of calling sys_execve so we | ||
287 | * end up with proper pt_regs. | ||
288 | */ | ||
289 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
290 | { | ||
291 | register long res __asm__("er0"); | ||
292 | register const char * _a __asm__("er1") = filename; | ||
293 | register void *_b __asm__("er2") = argv; | ||
294 | register void *_c __asm__("er3") = envp; | ||
295 | __asm__ __volatile__ ("mov.l %1,er0\n\t" | ||
296 | "trapa #0\n\t" | ||
297 | : "=r" (res) | ||
298 | : "g" (__NR_execve), | ||
299 | "g" (_a), | ||
300 | "g" (_b), | ||
301 | "g" (_c) | ||
302 | : "cc", "memory"); | ||
303 | return res; | ||
304 | } | ||
305 | |||
306 | |||