diff options
Diffstat (limited to 'arch/s390/kernel/sys_s390.c')
-rw-r--r-- | arch/s390/kernel/sys_s390.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index e351780bb660..584ed95f3380 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/file.h> | 27 | #include <linux/file.h> |
28 | #include <linux/utsname.h> | 28 | #include <linux/utsname.h> |
29 | #include <linux/personality.h> | 29 | #include <linux/personality.h> |
30 | #include <linux/unistd.h> | ||
30 | 31 | ||
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
32 | #include <asm/ipc.h> | 33 | #include <asm/ipc.h> |
@@ -266,3 +267,22 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args) | |||
266 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); | 267 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); |
267 | } | 268 | } |
268 | 269 | ||
270 | /* | ||
271 | * Do a system call from kernel instead of calling sys_execve so we | ||
272 | * end up with proper pt_regs. | ||
273 | */ | ||
274 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
275 | { | ||
276 | register const char *__arg1 asm("2") = filename; | ||
277 | register char *const*__arg2 asm("3") = argv; | ||
278 | register char *const*__arg3 asm("4") = envp; | ||
279 | register long __svcres asm("2"); | ||
280 | asm volatile( | ||
281 | "svc %b1" | ||
282 | : "=d" (__svcres) | ||
283 | : "i" (__NR_execve), | ||
284 | "0" (__arg1), | ||
285 | "d" (__arg2), | ||
286 | "d" (__arg3) : "memory"); | ||
287 | return __svcres; | ||
288 | } | ||