]> git.hungrycats.org Git - linux/commitdiff
[SPARC]: Update for new do_fork semantics.
authorDavid S. Miller <davem@nuts.ninka.net>
Thu, 21 Nov 2002 13:13:21 +0000 (05:13 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Thu, 21 Nov 2002 13:13:21 +0000 (05:13 -0800)
arch/sparc/kernel/process.c
arch/sparc64/kernel/process.c

index 24eb0311bf1cf609f81018fce6a1a844a1386755..a9bff8a7e08c05034fcbea26ea32cd2439470d44 100644 (file)
@@ -457,16 +457,20 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
                              struct pt_regs *regs,
                              unsigned long stack_size)
 {
-       unsigned long tid_ptr = 0;
+       unsigned long parent_tid_ptr = 0;
+       unsigned long child_tid_ptr = 0;
        struct task_struct *p;
 
        clone_flags &= ~CLONE_IDLETASK;
 
-       if (clone_flags & (CLONE_SETTID | CLONE_CLEARTID))
-               tid_ptr = regs->u_regs[UREG_G2];
-
+       if (clone_flags & (CLONE_SETTID | CLONE_CLEARTID)) {
+               parent_tid_ptr = regs->u_regs[UREG_G2];
+               child_tid_ptr = regs->u_regs[UREG_G3];
+       }
        p = do_fork(clone_flags, stack_start,
-                   regs, stack_size, (int *) tid_ptr);
+                   regs, stack_size,
+                   (int *) parent_tid_ptr,
+                   (int *) child_tid_ptr);
        return IS_ERR(p) ? PTR_ERR(p) : p->pid;
 }
 
@@ -507,7 +511,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
 #endif
        }
 
-       p->user_tid = NULL;
+       p->set_child_tid = p->clear_child_tid = NULL;
 
        /* Calculate offset to stack_frame & pt_regs */
        stack_offset = THREAD_SIZE - TRACEREG_SZ;
@@ -582,16 +586,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
        /* Set the return value for the parent. */
        regs->u_regs[UREG_I1] = 0;
 
-       if (!(clone_flags & (CLONE_SETTID | CLONE_CLEARTID)))
-               return 0;
-
-       if (clone_flags & CLONE_SETTID)
-               if (put_user(p->pid, (int *)childregs->u_regs[UREG_G2]))
-                       return -EFAULT;
-
-       if (clone_flags & CLONE_CLEARTID)
-               p->user_tid = (int *) childregs->u_regs[UREG_G2];
-
        return 0;
 }
 
index e45eb731ce2b777f987b17938ee7979d1f45c0a7..b16a23ba340af49ffb91746057cf81180bd7f4dc 100644 (file)
@@ -568,18 +568,24 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
                             unsigned long stack_size)
 {
        struct task_struct *p;
-       unsigned long tid_ptr = 0;
+       unsigned long parent_tid_ptr = 0;
+       unsigned long child_tid_ptr = 0;
 
        clone_flags &= ~CLONE_IDLETASK;
 
        if (clone_flags & (CLONE_SETTID | CLONE_CLEARTID)) {
-               tid_ptr = regs->u_regs[UREG_G2];
-               if (test_thread_flag(TIF_32BIT))
-                       tid_ptr &= 0xffffffff;
+               parent_tid_ptr = regs->u_regs[UREG_G2];
+               child_tid_ptr = regs->u_regs[UREG_G3];
+               if (test_thread_flag(TIF_32BIT)) {
+                       parent_tid_ptr &= 0xffffffff;
+                       child_tid_ptr &= 0xffffffff;
+               }
        }
 
        p = do_fork(clone_flags, stack_start,
-                   regs, stack_size, (int *) tid_ptr);
+                   regs, stack_size,
+                   (int *) parent_tid_ptr,
+                   (int *) child_tid_ptr);
 
        return IS_ERR(p) ? PTR_ERR(p) : p->pid;
 }
@@ -601,7 +607,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
        p->thread.smp_lock_pc = 0;
 #endif
 
-       p->user_tid = NULL;
+       p->set_child_tid = p->clear_child_tid = NULL;
 
        /* Calculate offset to stack_frame & pt_regs */
        child_trap_frame = ((char *)t) + (THREAD_SIZE - (TRACEREG_SZ+REGWIN_SZ));