Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys For cproc_t, use a per thread value instead of a per pro...



details:   https://anonhg.NetBSD.org/src/rev/be21899d8eab
branches:  trunk
changeset: 542487:be21899d8eab
user:      manu <manu%NetBSD.org@localhost>
date:      Thu Jan 30 19:14:18 2003 +0000

description:
For cproc_t, use a per thread value instead of a per process value. ifdef
out l_emuldata in struct lwp until we actually use it.

diffstat:

 sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_thread.c |  14 ++-------
 sys/compat/mach/mach_exec.c                                    |   9 ++++--
 sys/compat/mach/mach_exec.h                                    |   3 +-
 sys/compat/mach/mach_thread.c                                  |   5 ++-
 sys/sys/lwp.h                                                  |   4 ++-
 5 files changed, 17 insertions(+), 18 deletions(-)

diffs (149 lines):

diff -r 06896ec13df7 -r be21899d8eab sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_thread.c
--- a/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_thread.c    Thu Jan 30 18:57:06 2003 +0000
+++ b/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_thread.c    Thu Jan 30 19:14:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_fasttraps_thread.c,v 1.4 2003/01/24 22:35:43 manu Exp $ */
+/*     $NetBSD: mach_fasttraps_thread.c,v 1.5 2003/01/30 19:14:20 manu Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_thread.c,v 1.4 2003/01/24 22:35:43 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_thread.c,v 1.5 2003/01/30 19:14:20 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -61,11 +61,8 @@
        struct mach_sys_cthread_set_self_args /* {
                syscallarg(mach_cproc_t) p;
        } */ *uap = v;
-       struct mach_emuldata *med;
 
-       med = (struct mach_emuldata *)l->l_proc->p_emuldata;
-       med->med_p = SCARG(uap, p);
-       
+       l->l_private = (void *)SCARG(uap, p);
        return 0;
 }
 
@@ -75,10 +72,7 @@
        void *v;
        register_t *retval;
 {
-       struct mach_emuldata *med;
 
-       med = (struct mach_emuldata *)l->l_proc->p_emuldata;
-       *retval = (register_t)(med->med_p);
-
+       *retval = (register_t)l->l_private;
        return 0;
 }
diff -r 06896ec13df7 -r be21899d8eab sys/compat/mach/mach_exec.c
--- a/sys/compat/mach/mach_exec.c       Thu Jan 30 18:57:06 2003 +0000
+++ b/sys/compat/mach/mach_exec.c       Thu Jan 30 19:14:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_exec.c,v 1.24 2003/01/03 13:40:04 manu Exp $       */
+/*     $NetBSD: mach_exec.c,v 1.25 2003/01/30 19:14:19 manu Exp $       */
 
 /*-
  * Copyright (c) 2001-2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_exec.c,v 1.24 2003/01/03 13:40:04 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_exec.c,v 1.25 2003/01/30 19:14:19 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -214,6 +214,7 @@
        struct vmspace *vmspace;
 {
        struct mach_emuldata *med;
+       struct lwp *l;
 
        /* 
         * Initialize various things if needed. 
@@ -227,7 +228,6 @@
                    M_EMULDATA, M_WAITOK | M_ZERO);
 
        med = (struct mach_emuldata *)p->p_emuldata;
-       med->med_p = 0;
 
        LIST_INIT(&med->med_right);
        lockinit(&med->med_rightlock, PZERO|PCATCH, "mach_right", 0, 0);
@@ -251,6 +251,9 @@
        med->med_bootstrap = mach_bootstrap_port;
        med->med_bootstrap->mp_refcount++;
 
+       l = proc_representative_lwp(p);
+       l->l_private = (void *)0;
+
        return;
 }
 
diff -r 06896ec13df7 -r be21899d8eab sys/compat/mach/mach_exec.h
--- a/sys/compat/mach/mach_exec.h       Thu Jan 30 18:57:06 2003 +0000
+++ b/sys/compat/mach/mach_exec.h       Thu Jan 30 19:14:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_exec.h,v 1.13 2003/01/03 13:40:05 manu Exp $       */
+/*     $NetBSD: mach_exec.h,v 1.14 2003/01/30 19:14:19 manu Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,7 +44,6 @@
 #include <compat/mach/mach_types.h>
 
 struct mach_emuldata {
-       mach_cproc_t med_p;             /* Thread id */
        int med_thpri;                  /* Saved priority */
        LIST_HEAD(med_right, mach_right) med_right;
        struct lock med_rightlock;      /* process right list and lock */
diff -r 06896ec13df7 -r be21899d8eab sys/compat/mach/mach_thread.c
--- a/sys/compat/mach/mach_thread.c     Thu Jan 30 18:57:06 2003 +0000
+++ b/sys/compat/mach/mach_thread.c     Thu Jan 30 19:14:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_thread.c,v 1.17 2003/01/26 19:32:04 manu Exp $ */
+/*     $NetBSD: mach_thread.c,v 1.18 2003/01/30 19:14:19 manu Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_thread.c,v 1.17 2003/01/26 19:32:04 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_thread.c,v 1.18 2003/01/30 19:14:19 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -162,6 +162,7 @@
         * Make the child runnable
         */
        SCHED_LOCK(s);
+       mctc.mctc_lwp->l_private = 0;
        mctc.mctc_lwp->l_stat = LSRUN;
        setrunqueue(mctc.mctc_lwp);
        SCHED_UNLOCK(s);
diff -r 06896ec13df7 -r be21899d8eab sys/sys/lwp.h
--- a/sys/sys/lwp.h     Thu Jan 30 18:57:06 2003 +0000
+++ b/sys/sys/lwp.h     Thu Jan 30 19:14:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lwp.h,v 1.3 2003/01/21 04:06:06 matt Exp $     */
+/*     $NetBSD: lwp.h,v 1.4 2003/01/30 19:14:18 manu Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -85,7 +85,9 @@
 #define l_endcopy l_private
 
        void    *l_private;     /* svr4-style lwp-private data */
+#ifdef notyet
        void    *l_emuldata;    /* kernel lwp-private data */
+#endif
 
        int     l_locks;        /* DEBUG: lockmgr count of held locks */
 



Home | Main Index | Thread Index | Old Index