diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-04 08:34:57 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-14 19:36:37 -0400 |
commit | 7f1f311ac7b7b9c779fd207a20369f7fa3a61ba6 (patch) | |
tree | cf1fd972ab01e9c569bc8fe01226eec0f942681a /arch/parisc/kernel | |
parent | 4e5ed85ab5f1c9973588d7226c2894016059d9f6 (diff) |
parisc: switch to generic sys_execve()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/parisc/kernel')
-rw-r--r-- | arch/parisc/kernel/entry.S | 46 | ||||
-rw-r--r-- | arch/parisc/kernel/process.c | 23 | ||||
-rw-r--r-- | arch/parisc/kernel/sys_parisc32.c | 22 | ||||
-rw-r--r-- | arch/parisc/kernel/syscall_table.S | 2 |
4 files changed, 1 insertions, 92 deletions
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) | |||
1804 | ENDPROC(sys_vfork_wrapper) | 1804 | ENDPROC(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 | |||
1836 | error_\execve: | ||
1837 | bv %r0(%r19) | ||
1838 | nop | ||
1839 | .endm | ||
1840 | |||
1841 | .import sys_execve | ||
1842 | ENTRY(sys_execve_wrapper) | ||
1843 | execve_wrapper sys_execve | ||
1844 | ENDPROC(sys_execve_wrapper) | ||
1845 | |||
1846 | #ifdef CONFIG_64BIT | ||
1847 | .import sys32_execve | ||
1848 | ENTRY(sys32_execve_wrapper) | ||
1849 | execve_wrapper sys32_execve | ||
1850 | ENDPROC(sys32_execve_wrapper) | ||
1851 | #endif | ||
1852 | |||
1853 | ENTRY(sys_rt_sigreturn_wrapper) | 1807 | ENTRY(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 | |||
321 | asmlinkage 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); | ||
335 | out: | ||
336 | |||
337 | return error; | ||
338 | } | ||
339 | |||
340 | unsigned long | 317 | unsigned long |
341 | get_wchan(struct task_struct *p) | 318 | get_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 | |||
60 | asmlinkage 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); | ||
73 | out: | ||
74 | |||
75 | return error; | ||
76 | } | ||
77 | |||
78 | asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, | 56 | asmlinkage 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) |