svn commit: r247172 - in user/dchagin/lemul/sys: kern sys

Dmitry Chagin dchagin at FreeBSD.org
Sat Feb 23 08:17:45 UTC 2013


Author: dchagin
Date: Sat Feb 23 08:17:44 2013
New Revision: 247172
URL: http://svnweb.freebsd.org/changeset/base/247172

Log:
      In preparation for switching linuxulator to the use the native 1:1 threads
      split sys_thr_exit() up into sys_thr_exit() and kern_thr_exit().
      Where the second will be used in linux_exit() system call later.

Modified:
  user/dchagin/lemul/sys/kern/kern_thr.c
  user/dchagin/lemul/sys/sys/syscallsubr.h

Modified: user/dchagin/lemul/sys/kern/kern_thr.c
==============================================================================
--- user/dchagin/lemul/sys/kern/kern_thr.c	Sat Feb 23 08:16:00 2013	(r247171)
+++ user/dchagin/lemul/sys/kern/kern_thr.c	Sat Feb 23 08:17:44 2013	(r247172)
@@ -303,9 +303,6 @@ int
 sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
     /* long *state */
 {
-	struct proc *p;
-
-	p = td->td_proc;
 
 	/* Signal userland that it can free the stack. */
 	if ((void *)uap->state != NULL) {
@@ -313,6 +310,16 @@ sys_thr_exit(struct thread *td, struct t
 		kern_umtx_wake(td, uap->state, INT_MAX, 0);
 	}
 
+	return (kern_thr_exit(td));
+}
+
+int
+kern_thr_exit(struct thread *td)
+{
+	struct proc *p;
+
+	p = td->td_proc;
+
 	rw_wlock(&tidhash_lock);
 
 	PROC_LOCK(p);

Modified: user/dchagin/lemul/sys/sys/syscallsubr.h
==============================================================================
--- user/dchagin/lemul/sys/sys/syscallsubr.h	Sat Feb 23 08:16:00 2013	(r247171)
+++ user/dchagin/lemul/sys/sys/syscallsubr.h	Sat Feb 23 08:17:44 2013	(r247172)
@@ -223,6 +223,7 @@ int	kern_symlink(struct thread *td, char
 	    enum uio_seg segflg);
 int	kern_symlinkat(struct thread *td, char *path1, int fd, char *path2,
 	    enum uio_seg segflg);
+int	kern_thr_exit(struct thread *td);
 int	kern_thr_new(struct thread *td, struct thr_param *param);
 int	kern_thr_suspend(struct thread *td, struct timespec *tsp);
 int	kern_truncate(struct thread *td, char *path, enum uio_seg pathseg,


More information about the svn-src-user mailing list