PERFORCE change 101992 for review

Roman Divacky rdivacky at FreeBSD.org
Thu Jul 20 13:11:06 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=101992

Change 101992 by rdivacky at rdivacky_witten on 2006/07/20 13:10:53

	Changes:
	
	o		CLEARTID/SETTID swap just like linux does it. NetBSD differs here.
	o		in the linux binary execs to fbsd binary case remove the emuldata from
			the list and unlock the lock.

Affected files ...

.. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#18 edit

Differences ...

==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#18 (text+ko) ====

@@ -447,15 +447,15 @@
 		}
 	}
 	   	
+	if (args->flags & CLONE_CHILD_SETTID)
+		em->child_set_tid = args->child_tidptr;
+	else
+	   	em->child_set_tid = NULL;
+
 	if (args->flags & CLONE_CHILD_CLEARTID)
 		em->child_clear_tid = args->child_tidptr;
 	else
 	   	em->child_clear_tid = NULL;
-
-	if (args->flags & CLONE_CHILD_SETTID)
-		em->child_set_tid = args->child_tidptr;
-	else
-	   	em->child_set_tid = NULL;
 	EMUL_RUNLOCK(&emul_lock);
 
 	if (args->flags & CLONE_SETTLS) {
@@ -1216,6 +1216,16 @@
 #endif
 			return;			
 		}
+		
+		EMUL_RUNLOCK(&emul_lock);
+		/* XXX: there is a race but I think we can ommit that
+		 * because its not very possible that the same process
+		 * will exit on different cpus etc.
+		 */
+		EMUL_WLOCK(&emul_lock);
+		SLIST_REMOVE(&emuldata_head, em, linux_emuldata, emuldatas);
+		EMUL_WUNLOCK(&emul_lock);
+
 		FREE(em, M_LINUX);
 	}
 }


More information about the p4-projects mailing list