Loading arch/m32r/include/asm/unistd.h +3 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,9 @@ #define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_VFORK #define __IGNORE_lchown #define __IGNORE_setuid Loading arch/m32r/kernel/process.c +4 −42 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) } int copy_thread(unsigned long clone_flags, unsigned long spu, unsigned long arg, struct task_struct *tsk, struct pt_regs *regs) unsigned long arg, struct task_struct *tsk, struct pt_regs *unused) { struct pt_regs *childregs = task_pt_regs(tsk); extern void ret_from_fork(void); Loading @@ -206,7 +206,8 @@ int copy_thread(unsigned long clone_flags, unsigned long spu, tsk->thread.lr = (unsigned long)ret_from_kernel_thread; } else { /* Copy registers */ *childregs = *regs; *childregs = *current_pt_regs(); if (spu) childregs->spu = spu; childregs->r0 = 0; /* Child gets zero as return value */ tsk->thread.lr = (unsigned long)ret_from_fork; Loading @@ -216,45 +217,6 @@ int copy_thread(unsigned long clone_flags, unsigned long spu, return 0; } asmlinkage int sys_fork(void) { #ifdef CONFIG_MMU struct pt_regs *regs = current_pt_regs(); return do_fork(SIGCHLD, regs->spu, regs, 0, NULL, NULL); #else return -EINVAL; #endif /* CONFIG_MMU */ } asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, unsigned long parent_tidptr, unsigned long child_tidptr) { struct pt_regs *regs = current_pt_regs(); if (!newsp) newsp = regs->spu; return do_fork(clone_flags, newsp, regs, 0, (int __user *)parent_tidptr, (int __user *)child_tidptr); } /* * This is trivial, and on the face of it looks like it * could equally well be done in user mode. * * Not so, for quite unobvious reasons - register pressure. * In user mode vfork() cannot have a stack frame, and if * done by calling the "clone()" system call directly, you * do not have enough call-clobbered registers to hold all * the information you need. */ asmlinkage int sys_vfork(void) { struct pt_regs *regs = current_pt_regs(); return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->spu, regs, 0, NULL, NULL); } /* * These bracket the sleeping functions.. */ Loading Loading
arch/m32r/include/asm/unistd.h +3 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,9 @@ #define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_VFORK #define __IGNORE_lchown #define __IGNORE_setuid Loading
arch/m32r/kernel/process.c +4 −42 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) } int copy_thread(unsigned long clone_flags, unsigned long spu, unsigned long arg, struct task_struct *tsk, struct pt_regs *regs) unsigned long arg, struct task_struct *tsk, struct pt_regs *unused) { struct pt_regs *childregs = task_pt_regs(tsk); extern void ret_from_fork(void); Loading @@ -206,7 +206,8 @@ int copy_thread(unsigned long clone_flags, unsigned long spu, tsk->thread.lr = (unsigned long)ret_from_kernel_thread; } else { /* Copy registers */ *childregs = *regs; *childregs = *current_pt_regs(); if (spu) childregs->spu = spu; childregs->r0 = 0; /* Child gets zero as return value */ tsk->thread.lr = (unsigned long)ret_from_fork; Loading @@ -216,45 +217,6 @@ int copy_thread(unsigned long clone_flags, unsigned long spu, return 0; } asmlinkage int sys_fork(void) { #ifdef CONFIG_MMU struct pt_regs *regs = current_pt_regs(); return do_fork(SIGCHLD, regs->spu, regs, 0, NULL, NULL); #else return -EINVAL; #endif /* CONFIG_MMU */ } asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, unsigned long parent_tidptr, unsigned long child_tidptr) { struct pt_regs *regs = current_pt_regs(); if (!newsp) newsp = regs->spu; return do_fork(clone_flags, newsp, regs, 0, (int __user *)parent_tidptr, (int __user *)child_tidptr); } /* * This is trivial, and on the face of it looks like it * could equally well be done in user mode. * * Not so, for quite unobvious reasons - register pressure. * In user mode vfork() cannot have a stack frame, and if * done by calling the "clone()" system call directly, you * do not have enough call-clobbered registers to hold all * the information you need. */ asmlinkage int sys_vfork(void) { struct pt_regs *regs = current_pt_regs(); return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->spu, regs, 0, NULL, NULL); } /* * These bracket the sleeping functions.. */ Loading