aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-04 08:34:57 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-14 19:36:37 -0400
commit7f1f311ac7b7b9c779fd207a20369f7fa3a61ba6 (patch)
treecf1fd972ab01e9c569bc8fe01226eec0f942681a /arch/parisc
parent4e5ed85ab5f1c9973588d7226c2894016059d9f6 (diff)
parisc: switch to generic sys_execve()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/include/asm/unistd.h1
-rw-r--r--arch/parisc/kernel/entry.S46
-rw-r--r--arch/parisc/kernel/process.c23
-rw-r--r--arch/parisc/kernel/sys_parisc32.c22
-rw-r--r--arch/parisc/kernel/syscall_table.S2
5 files changed, 2 insertions, 92 deletions
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index 447e03c48232..b9e39f335909 100644
--- a/arch/parisc/include/asm/unistd.h
+++ b/arch/parisc/include/asm/unistd.h
@@ -996,6 +996,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
996#define __ARCH_WANT_SYS_RT_SIGSUSPEND 996#define __ARCH_WANT_SYS_RT_SIGSUSPEND
997#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 997#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
998#define __ARCH_WANT_KERNEL_EXECVE 998#define __ARCH_WANT_KERNEL_EXECVE
999#define __ARCH_WANT_SYS_EXECVE
999 1000
1000#endif /* __ASSEMBLY__ */ 1001#endif /* __ASSEMBLY__ */
1001 1002
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index a26917da9b2f..7d22e97347b7 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -1804,52 +1804,6 @@ ENTRY(sys_vfork_wrapper)
1804ENDPROC(sys_vfork_wrapper) 1804ENDPROC(sys_vfork_wrapper)
1805 1805
1806 1806
1807 .macro execve_wrapper execve
1808 LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
1809 ldo TASK_REGS(%r1),%r1 /* get pt regs */
1810
1811 /*
1812 * Do we need to save/restore r3-r18 here?
1813 * I don't think so. why would new thread need old
1814 * threads registers?
1815 */
1816
1817 /* %arg0 - %arg3 are already saved for us. */
1818
1819 STREG %r2,-RP_OFFSET(%r30)
1820 ldo FRAME_SIZE(%r30),%r30
1821#ifdef CONFIG_64BIT
1822 ldo -16(%r30),%r29 /* Reference param save area */
1823#endif
1824 BL \execve,%r2
1825 copy %r1,%arg0
1826
1827 ldo -FRAME_SIZE(%r30),%r30
1828 LDREG -RP_OFFSET(%r30),%r2
1829
1830 /* If exec succeeded we need to load the args */
1831
1832 ldo -1024(%r0),%r1
1833 cmpb,>>= %r28,%r1,error_\execve
1834 copy %r2,%r19
1835
1836error_\execve:
1837 bv %r0(%r19)
1838 nop
1839 .endm
1840
1841 .import sys_execve
1842ENTRY(sys_execve_wrapper)
1843 execve_wrapper sys_execve
1844ENDPROC(sys_execve_wrapper)
1845
1846#ifdef CONFIG_64BIT
1847 .import sys32_execve
1848ENTRY(sys32_execve_wrapper)
1849 execve_wrapper sys32_execve
1850ENDPROC(sys32_execve_wrapper)
1851#endif
1852
1853ENTRY(sys_rt_sigreturn_wrapper) 1807ENTRY(sys_rt_sigreturn_wrapper)
1854 LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 1808 LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26
1855 ldo TASK_REGS(%r26),%r26 /* get pt regs */ 1809 ldo TASK_REGS(%r26),%r26 /* get pt regs */
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index f3f6408bfb4f..44e8534c52e9 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -314,29 +314,6 @@ unsigned long thread_saved_pc(struct task_struct *t)
314 return t->thread.regs.kpc; 314 return t->thread.regs.kpc;
315} 315}
316 316
317/*
318 * sys_execve() executes a new program.
319 */
320
321asmlinkage int sys_execve(struct pt_regs *regs)
322{
323 int error;
324 struct filename *filename;
325
326 filename = getname((const char __user *) regs->gr[26]);
327 error = PTR_ERR(filename);
328 if (IS_ERR(filename))
329 goto out;
330 error = do_execve(filename->name,
331 (const char __user *const __user *) regs->gr[25],
332 (const char __user *const __user *) regs->gr[24],
333 regs);
334 putname(filename);
335out:
336
337 return error;
338}
339
340unsigned long 317unsigned long
341get_wchan(struct task_struct *p) 318get_wchan(struct task_struct *p)
342{ 319{
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index bf5b93a885d3..9cfdaa19ab63 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -53,28 +53,6 @@
53#define DBG(x) 53#define DBG(x)
54#endif 54#endif
55 55
56/*
57 * sys32_execve() executes a new program.
58 */
59
60asmlinkage int sys32_execve(struct pt_regs *regs)
61{
62 int error;
63 struct filename *filename;
64
65 DBG(("sys32_execve(%p) r26 = 0x%lx\n", regs, regs->gr[26]));
66 filename = getname((const char __user *) regs->gr[26]);
67 error = PTR_ERR(filename);
68 if (IS_ERR(filename))
69 goto out;
70 error = compat_do_execve(filename->name, compat_ptr(regs->gr[25]),
71 compat_ptr(regs->gr[24]), regs);
72 putname(filename);
73out:
74
75 return error;
76}
77
78asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, 56asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
79 int r22, int r21, int r20) 57 int r22, int r21, int r20)
80{ 58{
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 3735abd7f8f6..cb2da96d6ab9 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -66,7 +66,7 @@
66 ENTRY_SAME(creat) 66 ENTRY_SAME(creat)
67 ENTRY_SAME(link) 67 ENTRY_SAME(link)
68 ENTRY_SAME(unlink) /* 10 */ 68 ENTRY_SAME(unlink) /* 10 */
69 ENTRY_DIFF(execve_wrapper) 69 ENTRY_COMP(execve)
70 ENTRY_SAME(chdir) 70 ENTRY_SAME(chdir)
71 /* See comments in kernel/time.c!!! Maybe we don't need this? */ 71 /* See comments in kernel/time.c!!! Maybe we don't need this? */
72 ENTRY_COMP(time) 72 ENTRY_COMP(time)