Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be6abfa7 authored by Al Viro's avatar Al Viro
Browse files

powerpc: switch to generic sys_execve()/kernel_execve()



the only non-obvious part is that current_pt_regs() is really needed
here - task_pt_regs() is NULL for kernel threads; it's OK for ptrace
uses (the thing task_pt_regs() is intended for), but not for us.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 58254e10
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -125,6 +125,8 @@ extern unsigned long ptrace_get_reg(struct task_struct *task, int regno);
extern int ptrace_put_reg(struct task_struct *task, int regno,
			  unsigned long data);

#define current_pt_regs() \
	((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
/*
 * We use the least-significant bit of the trap field to indicate
 * whether we have saved the full set of registers, or only a
+0 −3
Original line number Diff line number Diff line
@@ -17,9 +17,6 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
		unsigned long prot, unsigned long flags,
		unsigned long fd, unsigned long pgoff);
asmlinkage int sys_execve(unsigned long a0, unsigned long a1,
		unsigned long a2, unsigned long a3, unsigned long a4,
		unsigned long a5, struct pt_regs *regs);
asmlinkage int sys_clone(unsigned long clone_flags, unsigned long usp,
		int __user *parent_tidp, void __user *child_threadptr,
		int __user *child_tidp, int p6, struct pt_regs *regs);
+2 −0
Original line number Diff line number Diff line
@@ -420,6 +420,8 @@
#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_NEWFSTATAT
#endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_KERNEL_EXECVE

/*
 * "Conditional" syscalls
+5 −0
Original line number Diff line number Diff line
@@ -446,6 +446,11 @@ ret_from_kernel_thread:
	li	r3,0
	b	do_exit		# no return

	.globl	__ret_from_kernel_execve
__ret_from_kernel_execve:
	addi	r1,r3,-STACK_FRAME_OVERHEAD
	b	ret_from_syscall

/* Traced system call support */
syscall_dotrace:
	SAVE_NVGPRS(r1)
+6 −0
Original line number Diff line number Diff line
@@ -380,6 +380,12 @@ _GLOBAL(ret_from_kernel_thread)
	li	r3,0
	b	.do_exit	# no return

_GLOBAL(__ret_from_kernel_execve)
	addi	r1,r3,-STACK_FRAME_OVERHEAD
	li	r10,1
	std	r10,SOFTE(r1)
	b	syscall_exit

	.section	".toc","aw"
DSCR_DEFAULT:
	.tc dscr_default[TC],dscr_default
Loading