]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tile: switch to generic sys_execve()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 20 Oct 2012 17:14:08 +0000 (13:14 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 23 Oct 2012 17:40:12 +0000 (13:40 -0400)
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/tile/include/asm/elf.h
arch/tile/include/asm/processor.h
arch/tile/include/asm/syscalls.h
arch/tile/include/asm/unistd.h
arch/tile/kernel/intvec_32.S
arch/tile/kernel/intvec_64.S
arch/tile/kernel/process.c
arch/tile/kernel/sys.c

index f8ccf08f6934704924f6081476d61d85e28b181f..b73e1039c911d48ad4956e1fad08fb0b546e7edf 100644 (file)
@@ -148,6 +148,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
 #define compat_start_thread(regs, ip, usp) do { \
                regs->pc = ptr_to_compat_reg((void *)(ip)); \
                regs->sp = ptr_to_compat_reg((void *)(usp)); \
+               single_step_execve();   \
        } while (0)
 
 /*
index 9a83e531e843368c8d667f9c594a2132dcf5ec3f..879073e765864202c02ba84fd5a520bdbca8df48 100644 (file)
@@ -211,6 +211,7 @@ static inline void start_thread(struct pt_regs *regs,
 {
        regs->pc = pc;
        regs->sp = usp;
+       single_step_execve();
 }
 
 /* Free all resources held by a thread. */
index 06f0464cfed941b3b15903749871b2f02005546a..0d52992f8e05e7aac85df02f3073d25d433a1a44 100644 (file)
@@ -68,9 +68,10 @@ long _sys_sigaltstack(const stack_t __user *, stack_t __user *);
 long _sys_rt_sigreturn(void);
 long _sys_clone(unsigned long clone_flags, unsigned long newsp,
                void __user *parent_tid, void __user *child_tid);
-long _sys_execve(const char __user *filename,
+long sys_execve(const char __user *filename,
                 const char __user *const __user *argv,
                 const char __user *const __user *envp);
+#define sys_execve sys_execve
 
 #include <asm-generic/syscalls.h>
 
index 6e032a0a268eebeacb8c04b4fb1f17f1da0bbcd3..dab827dc8acb01e6af2e985549315e8a50d3774e 100644 (file)
@@ -16,4 +16,5 @@
 #define __ARCH_WANT_SYS_LLSEEK
 #endif
 #define __ARCH_WANT_SYS_NEWFSTATAT
+#define __ARCH_WANT_SYS_EXECVE
 #include <uapi/asm/unistd.h>
index 58aad519b7d6f67b3409694bed8facc5bd299629..174b837ef9265deed933f1a12ae668c8715cbf14 100644 (file)
@@ -1476,7 +1476,6 @@ STD_ENTRY_LOCAL(bad_intr)
        };                                              \
        STD_ENDPROC(_##x)
 
-PTREGS_SYSCALL(sys_execve, r3)
 PTREGS_SYSCALL(sys_sigaltstack, r2)
 PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0)
 PTREGS_SYSCALL(sys_cmpxchg_badaddr, r1)
index f66bd5f67d4491719119419219618f576118815d..283efedf67d6feb5c0635b8a0367742445ba011c 100644 (file)
@@ -1205,7 +1205,6 @@ STD_ENTRY_LOCAL(bad_intr)
        };                                              \
        STD_ENDPROC(_##x)
 
-PTREGS_SYSCALL(sys_execve, r3)
 PTREGS_SYSCALL(sys_sigaltstack, r2)
 PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0)
 #ifdef CONFIG_COMPAT
index da6e4d78da6e1ebbb20a792a92f161d86e9c4abc..58f8fd1f0bc2f2a67ca5e9289f43af50a4968d0c 100644 (file)
@@ -594,51 +594,6 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
                       parent_tidptr, child_tidptr);
 }
 
-/*
- * sys_execve() executes a new program.
- */
-SYSCALL_DEFINE4(execve, const char __user *, path,
-               const char __user *const __user *, argv,
-               const char __user *const __user *, envp,
-               struct pt_regs *, regs)
-{
-       long error;
-       struct filename *filename;
-
-       filename = getname(path);
-       error = PTR_ERR(filename);
-       if (IS_ERR(filename))
-               goto out;
-       error = do_execve(filename->name, argv, envp, regs);
-       putname(filename);
-       if (error == 0)
-               single_step_execve();
-out:
-       return error;
-}
-
-#ifdef CONFIG_COMPAT
-long compat_sys_execve(const char __user *path,
-                      compat_uptr_t __user *argv,
-                      compat_uptr_t __user *envp)
-{
-       long error;
-       struct filename *filename;
-
-       filename = getname(path);
-       error = PTR_ERR(filename);
-       if (IS_ERR(filename))
-               goto out;
-       error = compat_do_execve(filename->name, argv, envp,
-                                current_pt_regs());
-       putname(filename);
-       if (error == 0)
-               single_step_execve();
-out:
-       return error;
-}
-#endif
-
 unsigned long get_wchan(struct task_struct *p)
 {
        struct KBacktraceIterator kbt;
index b08095b402d6c3d5f0a1f651b8c5578ed39c15fa..359e76f68838583c06ed8369e62cabaf1c8bda55 100644 (file)
@@ -107,7 +107,6 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
 #endif
 
 /* Call the trampolines to manage pt_regs where necessary. */
-#define sys_execve _sys_execve
 #define sys_sigaltstack _sys_sigaltstack
 #define sys_rt_sigreturn _sys_rt_sigreturn
 #define sys_clone _sys_clone