summaryrefslogtreecommitdiff
path: root/arch/alpha/kernel/process.c
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2012-08-19 14:41:00 +1200
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-19 08:41:19 -0700
commit28d353d9891c28496e366bebe4e65233f59ad1f6 (patch)
tree814900bf40b5e24c4b50396c4df22058fc951c60 /arch/alpha/kernel/process.c
parentbe53db6e4edd9dc013b21a929ad2b142dea8b9c0 (diff)
alpha: take kernel_execve() out of entry.S
Signed-off-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Michael Cree <mcree@orcon.net.nz> Acked-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha/kernel/process.c')
-rw-r--r--arch/alpha/kernel/process.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 153d3fce3e8e..d6fde98b74b3 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -455,3 +455,22 @@ get_wchan(struct task_struct *p)
}
return pc;
}
+
+int kernel_execve(const char *path, const char *const argv[], const char *const envp[])
+{
+ /* Avoid the HAE being gratuitously wrong, which would cause us
+ to do the whole turn off interrupts thing and restore it. */
+ struct pt_regs regs = {.hae = alpha_mv.hae_cache};
+ int err = do_execve(path, argv, envp, &regs);
+ if (!err) {
+ struct pt_regs *p = current_pt_regs();
+ /* copy regs to normal position and off to userland we go... */
+ *p = regs;
+ __asm__ __volatile__ (
+ "mov %0, $sp;"
+ "br $31, ret_from_sys_call"
+ : : "r"(p));
+ }
+ return err;
+}
+EXPORT_SYMBOL(kernel_execve);