cris: switch to generic kernel_execve/sys_execve
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 3 Oct 2012 18:56:02 +0000 (14:56 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 15 Oct 2012 03:12:33 +0000 (23:12 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/cris/Kconfig
arch/cris/arch-v10/kernel/entry.S
arch/cris/arch-v10/kernel/process.c
arch/cris/arch-v32/kernel/entry.S
arch/cris/arch-v32/kernel/process.c
arch/cris/include/asm/unistd.h

index 3336a7d25341571e8b7f8c0f12ecb4de90486a94..81b59d18867ec68be4995bb00adf1b8c1e37f65a 100644 (file)
@@ -50,6 +50,7 @@ config CRIS
        select GENERIC_CMOS_UPDATE
        select MODULES_USE_ELF_RELA
        select GENERIC_KERNEL_THREAD
+       select GENERIC_KERNEL_EXECVE
 
 config HZ
        int
index b8e39e00acb2cb6a08c520ce19e5f14f5e180494..897bba67bf7afed9a0b392db5d652349ae352f6c 100644 (file)
@@ -87,8 +87,8 @@ ret_from_kernel_thread:
        jsr schedule_tail
        move.d  $r2, $r10       ; argument is here
        jsr     $r1             ; call the payload
-       moveq   0, $r10
-       jsr     sys_exit        ; never returns
+       moveq   0, $r9          ; no syscall restarts, TYVM...
+       ba  ret_from_sys_call
 
 ret_from_intr:
        ;; check for resched if preemptive kernel or if we're going back to user-mode 
@@ -594,13 +594,6 @@ _ugdb_handle_breakpoint:
        ba      do_sigtrap              ; SIGTRAP the offending process. 
        pop     $dccr                   ; Restore dccr in delay slot.
 
-       .global kernel_execve
-kernel_execve:
-       move.d __NR_execve, $r9
-       break 13
-       ret
-       nop
-
        .data
 
 hw_bp_trigs:
index 8a673aa81cddb874e65d551427ff47baa005e6a6..1d6458287f380ea8979b93b1fdf3539ec5346720 100644 (file)
@@ -167,29 +167,6 @@ asmlinkage int sys_vfork(void)
         return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL);
 }
 
-/*
- * sys_execve() executes a new program.
- */
-asmlinkage int sys_execve(const char *fname,
-                         const char *const *argv,
-                         const char *const *envp,
-                         long r13, long mof, long srp, 
-                         struct pt_regs *regs)
-{
-       int error;
-       struct filename *filename;
-
-       filename = getname(fname);
-       error = PTR_ERR(filename);
-
-       if (IS_ERR(filename))
-               goto out;
-       error = do_execve(filename->name, argv, envp, regs);
-       putname(filename);
- out:
-       return error;
-}
-
 unsigned long get_wchan(struct task_struct *p)
 {
 #if 0
index a9bcbc419278e8a336874ab542f98bbf0228aff5..faa644111feb7f4acb1eb87929177fdc3cdc3dc6 100644 (file)
@@ -92,8 +92,8 @@ ret_from_kernel_thread:
        move.d  $r2, $r10
        jsr     $r1
        nop
-       moveq   0, $r10
-       jsr     sys_exit
+       moveq   0, $r9                  ; no syscall restarts, TYVM...
+       ba  ret_from_sys_call
        nop
        .size   ret_from_kernel_thread, . - ret_from_kernel_thread
 
@@ -544,15 +544,6 @@ _ugdb_handle_exception:
        ba      do_sigtrap              ; SIGTRAP the offending process.
        move.d  [$sp+], $r0             ; Restore R0 in delay slot.
 
-       .global kernel_execve
-       .type   kernel_execve,@function
-kernel_execve:
-       move.d __NR_execve, $r9
-       break 13
-       ret
-       nop
-       .size   kernel_execve, . - kernel_execve
-
        .data
 
        .section .rodata,"a"
index 3edbdb88110ee0880b3f1170880199f307a199fa..fe465401b6eca41bcc3a0cbd60fe6dea0ba149dd 100644 (file)
@@ -186,28 +186,6 @@ sys_vfork(void)
        return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL);
 }
 
-/* sys_execve() executes a new program. */
-asmlinkage int
-sys_execve(const char *fname,
-          const char *const *argv,
-          const char *const *envp, long r13, long mof, long srp,
-          struct pt_regs *regs)
-{
-       int error;
-       struct filename *filename;
-
-       filename = getname(fname);
-       error = PTR_ERR(filename);
-
-       if (IS_ERR(filename))
-               goto out;
-
-       error = do_execve(filename->name, argv, envp, regs);
-       putname(filename);
- out:
-       return error;
-}
-
 unsigned long
 get_wchan(struct task_struct *p)
 {
index 51873a446f87e870f44db25c3dcfd2d1522eb0d2..f181d1fc76326e0846fe2c2f584e41e5f3e16b81 100644 (file)
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_EXECVE
 
 /*
  * "Conditional" syscalls