Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jul 2006 13:11:05 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 101992 for review
Message-ID:  <200607201311.k6KDB5gH002636@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101992

Change 101992 by rdivacky@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);
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607201311.k6KDB5gH002636>