[BACK]Return to lwproc.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / rump / librump / rumpkern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/rump/librump/rumpkern/lwproc.c between version 1.10.4.2 and 1.11

version 1.10.4.2, 2011/02/17 12:00:51 version 1.11, 2011/01/28 16:34:31
Line 53  lwproc_proc_free(struct proc *p)
Line 53  lwproc_proc_free(struct proc *p)
   
         KASSERT(p->p_nlwps == 0);          KASSERT(p->p_nlwps == 0);
         KASSERT(LIST_EMPTY(&p->p_lwps));          KASSERT(LIST_EMPTY(&p->p_lwps));
         KASSERT(p->p_stat == SACTIVE || p->p_stat == SDYING ||          KASSERT(p->p_stat == SIDL || p->p_stat == SDEAD);
             p->p_stat == SDEAD);  
   
         LIST_REMOVE(p, p_list);          LIST_REMOVE(p, p_list);
         LIST_REMOVE(p, p_sibling);          LIST_REMOVE(p, p_sibling);
Line 112  lwproc_newproc(struct proc *parent, int 
Line 111  lwproc_newproc(struct proc *parent, int 
             offsetof(struct proc, p_endcopy)              offsetof(struct proc, p_endcopy)
               - offsetof(struct proc, p_startcopy));                - offsetof(struct proc, p_startcopy));
   
         /* some other garbage we need to zero */  
         p->p_sigacts = NULL;  
         p->p_aio = NULL;  
         p->p_dtrace = NULL;  
         p->p_mqueue_cnt = p->p_exitsig = 0;  
         p->p_flag = p->p_sflag = p->p_slflag = p->p_lflag = p->p_stflag = 0;  
         p->p_trace_enabled = 0;  
         p->p_xstat = p->p_acflag = 0;  
         p->p_stackbase = 0;  
   
         p->p_stats = pstatscopy(parent->p_stats);          p->p_stats = pstatscopy(parent->p_stats);
   
         p->p_vmspace = vmspace_kernel();          p->p_vmspace = vmspace_kernel();
         p->p_emul = &emul_netbsd;          p->p_emul = &emul_netbsd;
         if (*parent->p_comm)          strcpy(p->p_comm, "rumproc");
                 strcpy(p->p_comm, parent->p_comm);  
         else  
                 strcpy(p->p_comm, "rumproc");  
   
         if ((flags & RUMP_RFCFDG) == 0)          if ((flags & RUMP_RFCFDG) == 0)
                 KASSERT(parent == curproc);                  KASSERT(parent == curproc);
Line 155  lwproc_newproc(struct proc *parent, int 
Line 141  lwproc_newproc(struct proc *parent, int 
   
         p->p_pptr = parent;          p->p_pptr = parent;
         p->p_ppid = parent->p_pid;          p->p_ppid = parent->p_pid;
         p->p_stat = SACTIVE;  
   
         kauth_proc_fork(parent, p);          kauth_proc_fork(parent, p);
   
Line 214  lwproc_freelwp(struct lwp *l)
Line 199  lwproc_freelwp(struct lwp *l)
                 lwproc_proc_free(p);                  lwproc_proc_free(p);
 }  }
   
 extern kmutex_t unruntime_lock;  
   
 /*  /*
  * called with p_lock held, releases lock before return   * called with p_lock held, releases lock before return
  */   */
Line 234  lwproc_makelwp(struct proc *p, struct lw
Line 217  lwproc_makelwp(struct proc *p, struct lw
         lwp_update_creds(l);          lwp_update_creds(l);
   
         l->l_fd = p->p_fd;          l->l_fd = p->p_fd;
         l->l_cpu = rump_cpu;          l->l_cpu = NULL;
         l->l_target_cpu = rump_cpu; /* Initial target CPU always the same */          l->l_target_cpu = rump_cpu; /* Initial target CPU always the same */
         l->l_stat = LSRUN;          l->l_stat = LSRUN;
         l->l_mutex = &unruntime_lock;  
         TAILQ_INIT(&l->l_ld_locks);          TAILQ_INIT(&l->l_ld_locks);
   
         lwp_initspecific(l);          lwp_initspecific(l);
Line 359  rump_lwproc_switch(struct lwp *newlwp)
Line 341  rump_lwproc_switch(struct lwp *newlwp)
         }          }
         mutex_exit(newlwp->l_proc->p_lock);          mutex_exit(newlwp->l_proc->p_lock);
   
         l->l_mutex = &unruntime_lock;          l->l_mutex = NULL;
           l->l_cpu = NULL;
         l->l_pflag &= ~LP_RUNNING;          l->l_pflag &= ~LP_RUNNING;
         l->l_flag &= ~LW_PENDSIG;          l->l_flag &= ~LW_PENDSIG;
         l->l_stat = LSRUN;  
   
         if (l->l_flag & LW_WEXIT) {          if (l->l_flag & LW_WEXIT) {
                 lwproc_freelwp(l);                  lwproc_freelwp(l);

Legend:
Removed from v.1.10.4.2  
changed lines
  Added in v.1.11

CVSweb <webmaster@jp.NetBSD.org>