aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/sys_m68k.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 143c552d38f3..90238a8c9e14 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -27,6 +27,7 @@
27#include <asm/traps.h> 27#include <asm/traps.h>
28#include <asm/ipc.h> 28#include <asm/ipc.h>
29#include <asm/page.h> 29#include <asm/page.h>
30#include <asm/unistd.h>
30 31
31/* 32/*
32 * sys_pipe() is the normal C calling standard for creating 33 * sys_pipe() is the normal C calling standard for creating
@@ -663,3 +664,18 @@ asmlinkage int sys_getpagesize(void)
663{ 664{
664 return PAGE_SIZE; 665 return PAGE_SIZE;
665} 666}
667
668/*
669 * Do a system call from kernel instead of calling sys_execve so we
670 * end up with proper pt_regs.
671 */
672int kernel_execve(const char *filename, char *const argv[], char *const envp[])
673{
674 register long __res asm ("%d0") = __NR_execve;
675 register long __a asm ("%d1") = (long)(filename);
676 register long __b asm ("%d2") = (long)(argv);
677 register long __c asm ("%d3") = (long)(envp);
678 asm volatile ("trap #0" : "+d" (__res)
679 : "d" (__a), "d" (__b), "d" (__c));
680 return __res;
681}