@@ -1527,8 +1527,6 @@ static inline void init_idle_pids(struct pid_link *links)
15271527struct task_struct * __cpuinit fork_idle (int cpu )
15281528{
15291529 struct task_struct * task ;
1530- struct pt_regs regs ;
1531-
15321530 task = copy_process (CLONE_VM , 0 , 0 , NULL , & init_struct_pid , 0 );
15331531 if (!IS_ERR (task )) {
15341532 init_idle_pids (task -> pids );
@@ -1546,7 +1544,6 @@ struct task_struct * __cpuinit fork_idle(int cpu)
15461544 */
15471545long do_fork (unsigned long clone_flags ,
15481546 unsigned long stack_start ,
1549- struct pt_regs * regs ,
15501547 unsigned long stack_size ,
15511548 int __user * parent_tidptr ,
15521549 int __user * child_tidptr )
@@ -1576,7 +1573,7 @@ long do_fork(unsigned long clone_flags,
15761573 * requested, no event is reported; otherwise, report if the event
15771574 * for the type of forking is enabled.
15781575 */
1579- if (!(clone_flags & CLONE_UNTRACED ) && likely ( user_mode ( regs )) ) {
1576+ if (!(clone_flags & CLONE_UNTRACED )) {
15801577 if (clone_flags & CLONE_VFORK )
15811578 trace = PTRACE_EVENT_VFORK ;
15821579 else if ((clone_flags & CSIGNAL ) != SIGCHLD )
@@ -1632,7 +1629,7 @@ long do_fork(unsigned long clone_flags,
16321629 */
16331630pid_t kernel_thread (int (* fn )(void * ), void * arg , unsigned long flags )
16341631{
1635- return do_fork (flags |CLONE_VM |CLONE_UNTRACED , (unsigned long )fn , NULL ,
1632+ return do_fork (flags |CLONE_VM |CLONE_UNTRACED , (unsigned long )fn ,
16361633 (unsigned long )arg , NULL , NULL );
16371634}
16381635#endif
@@ -1641,7 +1638,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
16411638SYSCALL_DEFINE0 (fork )
16421639{
16431640#ifdef CONFIG_MMU
1644- return do_fork (SIGCHLD , 0 , current_pt_regs (), 0 , NULL , NULL );
1641+ return do_fork (SIGCHLD , 0 , 0 , NULL , NULL );
16451642#else
16461643 /* can not support in nommu mode */
16471644 return (- EINVAL );
@@ -1652,7 +1649,7 @@ SYSCALL_DEFINE0(fork)
16521649#ifdef __ARCH_WANT_SYS_VFORK
16531650SYSCALL_DEFINE0 (vfork )
16541651{
1655- return do_fork (CLONE_VFORK | CLONE_VM | SIGCHLD , 0 , current_pt_regs (),
1652+ return do_fork (CLONE_VFORK | CLONE_VM | SIGCHLD , 0 ,
16561653 0 , NULL , NULL );
16571654}
16581655#endif
@@ -1675,7 +1672,7 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
16751672 int , tls_val )
16761673#endif
16771674{
1678- return do_fork (clone_flags , newsp , current_pt_regs (), 0 ,
1675+ return do_fork (clone_flags , newsp , 0 ,
16791676 parent_tidptr , child_tidptr );
16801677}
16811678#endif
0 commit comments