Skip to content

Commit

Permalink
parisc: switch to generic sys_execve()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 14, 2012
1 parent 4e5ed85 commit 7f1f311
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 92 deletions.
1 change: 1 addition & 0 deletions arch/parisc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_KERNEL_EXECVE
#define __ARCH_WANT_SYS_EXECVE

#endif /* __ASSEMBLY__ */

Expand Down
46 changes: 0 additions & 46 deletions arch/parisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1804,52 +1804,6 @@ ENTRY(sys_vfork_wrapper)
ENDPROC(sys_vfork_wrapper)


.macro execve_wrapper execve
LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
ldo TASK_REGS(%r1),%r1 /* get pt regs */

/*
* Do we need to save/restore r3-r18 here?
* I don't think so. why would new thread need old
* threads registers?
*/

/* %arg0 - %arg3 are already saved for us. */

STREG %r2,-RP_OFFSET(%r30)
ldo FRAME_SIZE(%r30),%r30
#ifdef CONFIG_64BIT
ldo -16(%r30),%r29 /* Reference param save area */
#endif
BL \execve,%r2
copy %r1,%arg0

ldo -FRAME_SIZE(%r30),%r30
LDREG -RP_OFFSET(%r30),%r2

/* If exec succeeded we need to load the args */

ldo -1024(%r0),%r1
cmpb,>>= %r28,%r1,error_\execve
copy %r2,%r19

error_\execve:
bv %r0(%r19)
nop
.endm

.import sys_execve
ENTRY(sys_execve_wrapper)
execve_wrapper sys_execve
ENDPROC(sys_execve_wrapper)

#ifdef CONFIG_64BIT
.import sys32_execve
ENTRY(sys32_execve_wrapper)
execve_wrapper sys32_execve
ENDPROC(sys32_execve_wrapper)
#endif

ENTRY(sys_rt_sigreturn_wrapper)
LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26
ldo TASK_REGS(%r26),%r26 /* get pt regs */
Expand Down
23 changes: 0 additions & 23 deletions arch/parisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,29 +314,6 @@ unsigned long thread_saved_pc(struct task_struct *t)
return t->thread.regs.kpc;
}

/*
* sys_execve() executes a new program.
*/

asmlinkage int sys_execve(struct pt_regs *regs)
{
int error;
struct filename *filename;

filename = getname((const char __user *) regs->gr[26]);
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
error = do_execve(filename->name,
(const char __user *const __user *) regs->gr[25],
(const char __user *const __user *) regs->gr[24],
regs);
putname(filename);
out:

return error;
}

unsigned long
get_wchan(struct task_struct *p)
{
Expand Down
22 changes: 0 additions & 22 deletions arch/parisc/kernel/sys_parisc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,6 @@
#define DBG(x)
#endif

/*
* sys32_execve() executes a new program.
*/

asmlinkage int sys32_execve(struct pt_regs *regs)
{
int error;
struct filename *filename;

DBG(("sys32_execve(%p) r26 = 0x%lx\n", regs, regs->gr[26]));
filename = getname((const char __user *) regs->gr[26]);
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
error = compat_do_execve(filename->name, compat_ptr(regs->gr[25]),
compat_ptr(regs->gr[24]), regs);
putname(filename);
out:

return error;
}

asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
int r22, int r21, int r20)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/kernel/syscall_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
ENTRY_SAME(creat)
ENTRY_SAME(link)
ENTRY_SAME(unlink) /* 10 */
ENTRY_DIFF(execve_wrapper)
ENTRY_COMP(execve)
ENTRY_SAME(chdir)
/* See comments in kernel/time.c!!! Maybe we don't need this? */
ENTRY_COMP(time)
Expand Down

0 comments on commit 7f1f311

Please sign in to comment.