From d878d6dacee2c862f02da20f7fa3e2c0e8820e71 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 16 Sep 2012 12:06:34 -0400 Subject: m68k: switch to generic sys_execve()/kernel_execve() The tricky part here is that task_pt_regs() on m68k works *only* for process inside do_signal(). However, we need something much simpler - pt_regs of a process inside do_signal() may be at different offsets from the stack bottom, depending on the way we'd entered the kernel, but for a task inside sys_execve() it *is* at constant offset. Moreover, for a kernel thread about to become a userland process the same location is also fine - setting sp to that will leave the kernel stack pointer at the very bottom of the kernel stack when we finally switch to userland. Signed-off-by: Al Viro --- arch/m68k/kernel/sys_m68k.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'arch/m68k/kernel/sys_m68k.c') diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 9a5932e..3a480b3 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -549,23 +549,6 @@ asmlinkage int sys_getpagesize(void) return PAGE_SIZE; } -/* - * 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, - const char *const argv[], - const char *const envp[]) -{ - register long __res asm ("%d0") = __NR_execve; - register long __a asm ("%d1") = (long)(filename); - register long __b asm ("%d2") = (long)(argv); - register long __c asm ("%d3") = (long)(envp); - asm volatile ("trap #0" : "+d" (__res) - : "d" (__a), "d" (__b), "d" (__c)); - return __res; -} - asmlinkage unsigned long sys_get_thread_area(void) { return current_thread_info()->tp_value; -- cgit v1.1