diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-18 22:45:24 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-23 22:05:21 -0400 |
commit | 995218555433b260b58059802e1c01f35b4cd860 (patch) | |
tree | 801d384bdc54c104049eee2bf007c02d639a34ce /arch/hexagon/kernel/syscall.c | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) | |
download | linux-995218555433b260b58059802e1c01f35b4cd860.tar.bz2 |
hexagon: kernel_thread()/kernel_execve() conversion
introduce sane current_pt_regs(), use it in syscalls where needed.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/hexagon/kernel/syscall.c')
-rw-r--r-- | arch/hexagon/kernel/syscall.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/arch/hexagon/kernel/syscall.c b/arch/hexagon/kernel/syscall.c index 25a9bfe3445d..120f1a5e9f3d 100644 --- a/arch/hexagon/kernel/syscall.c +++ b/arch/hexagon/kernel/syscall.c @@ -39,7 +39,7 @@ asmlinkage int sys_execve(char __user *ufilename, const char __user *const __user *argv, const char __user *const __user *envp) { - struct pt_regs *pregs = current_thread_info()->regs; + struct pt_regs *pregs = current_pt_regs(); struct filename *filename; int retval; @@ -57,33 +57,10 @@ asmlinkage int sys_execve(char __user *ufilename, asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, unsigned long parent_tidp, unsigned long child_tidp) { - struct pt_regs *pregs = current_thread_info()->regs; + struct pt_regs *pregs = current_pt_regs(); if (!newsp) newsp = pregs->SP; return do_fork(clone_flags, newsp, pregs, 0, (int __user *)parent_tidp, (int __user *)child_tidp); } - -/* - * Do a system call from the kernel, so as to have a proper pt_regs - * and recycle the sys_execvpe infrustructure. - */ -int kernel_execve(const char *filename, - const char *const argv[], const char *const envp[]) -{ - register unsigned long __a0 asm("r0") = (unsigned long) filename; - register unsigned long __a1 asm("r1") = (unsigned long) argv; - register unsigned long __a2 asm("r2") = (unsigned long) envp; - int retval; - - __asm__ volatile( - " R6 = #%4;\n" - " trap0(#1);\n" - " %0 = R0;\n" - : "=r" (retval) - : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve) - ); - - return retval; -} |