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

Commit 50150d2b authored by Al Viro's avatar Al Viro
Browse files

mips: switch to generic sys_fork() and sys_clone()



we still need the wrappers to store callee-saved registers in
pt_regs, but once that done we can jump to kernel/fork.c variants.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 64b3122d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ config MIPS
	select HAVE_MOD_ARCH_SPECIFIC
	select MODULES_USE_ELF_REL if MODULES
	select MODULES_USE_ELF_RELA if MODULES && 64BIT
	select CLONE_BACKWARDS
	select GENERIC_SIGALTSTACK
	select GENERIC_COMPAT_RT_SIGACTION
	select GENERIC_COMPAT_RT_SIGQUEUEINFO
+12 −12
Original line number Diff line number Diff line
@@ -20,10 +20,10 @@
#define save_static_function(symbol)					\
__asm__(								\
	".text\n\t"							\
	".globl\t" #symbol "\n\t"					\
	".globl\t__" #symbol "\n\t"					\
	".align\t2\n\t"							\
	".type\t" #symbol ", @function\n\t"				\
	".ent\t" #symbol ", 0\n"					\
	".type\t__" #symbol ", @function\n\t"				\
	".ent\t__" #symbol ", 0\n__"					\
	#symbol":\n\t"							\
	".frame\t$29, 0, $31\n\t"					\
	"sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t"	\
@@ -35,9 +35,9 @@ __asm__( \
	"sw\t$22,"__str(PT_R22)"($29)\n\t"				\
	"sw\t$23,"__str(PT_R23)"($29)\n\t"				\
	"sw\t$30,"__str(PT_R30)"($29)\n\t"				\
	"j\t_" #symbol "\n\t"						\
	".end\t" #symbol "\n\t"						\
	".size\t" #symbol",. - " #symbol)
	"j\t" #symbol "\n\t"						\
	".end\t__" #symbol "\n\t"					\
	".size\t__" #symbol",. - __" #symbol)

#define nabi_no_regargs

@@ -48,10 +48,10 @@ __asm__( \
#define save_static_function(symbol)					\
__asm__(								\
	".text\n\t"							\
	".globl\t" #symbol "\n\t"					\
	".globl\t__" #symbol "\n\t"					\
	".align\t2\n\t"							\
	".type\t" #symbol ", @function\n\t"				\
	".ent\t" #symbol ", 0\n"					\
	".type\t__" #symbol ", @function\n\t"				\
	".ent\t__" #symbol ", 0\n__"					\
	#symbol":\n\t"							\
	".frame\t$29, 0, $31\n\t"					\
	"sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t"	\
@@ -63,9 +63,9 @@ __asm__( \
	"sd\t$22,"__str(PT_R22)"($29)\n\t"				\
	"sd\t$23,"__str(PT_R23)"($29)\n\t"				\
	"sd\t$30,"__str(PT_R30)"($29)\n\t"				\
	"j\t_" #symbol "\n\t"						\
	".end\t" #symbol "\n\t"						\
	".size\t" #symbol",. - " #symbol)
	"j\t" #symbol "\n\t"						\
	".end\t__" #symbol "\n\t"					\
	".size\t__" #symbol",. - __" #symbol)

#define nabi_no_regargs							\
	unsigned long __dummy0,						\
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@
# ifdef CONFIG_MIPS32_O32
#  define __ARCH_WANT_COMPAT_SYS_TIME
# endif
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_CLONE

/* whitelists for checksyscalls */
#define __IGNORE_select
+0 −19
Original line number Diff line number Diff line
@@ -279,25 +279,6 @@ asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2,
	                     merge_64(len_a4, len_a5));
}

save_static_function(sys32_clone);
static int noinline __used
_sys32_clone(nabi_no_regargs struct pt_regs regs)
{
	unsigned long clone_flags;
	unsigned long newsp;
	int __user *parent_tidptr, *child_tidptr;

	clone_flags = regs.regs[4];
	newsp = regs.regs[5];
	parent_tidptr = (int __user *) regs.regs[6];

	/* Use __dummy4 instead of getting it off the stack, so that
	   syscall() works.  */
	child_tidptr = (int __user *) __dummy4;
	return do_fork(clone_flags, newsp, 0,
	               parent_tidptr, child_tidptr);
}

asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf,
	size_t len)
{
+2 −2
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ einval: li v0, -ENOSYS
	.macro	syscalltable
	sys	sys_syscall		8	/* 4000 */
	sys	sys_exit		1
	sys	sys_fork		0
	sys	__sys_fork		0
	sys	sys_read		3
	sys	sys_write		3
	sys	sys_open		3	/* 4005 */
@@ -344,7 +344,7 @@ einval: li v0, -ENOSYS
	sys	sys_ipc			6
	sys	sys_fsync		1
	sys	sys_sigreturn		0
	sys	sys_clone		0	/* 4120 */
	sys	__sys_clone		6	/* 4120 */
	sys	sys_setdomainname	2
	sys	sys_newuname		1
	sys	sys_ni_syscall		0	/* sys_modify_ldt */
Loading