[BACK]Return to lwp.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / sys

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

Diff for /src/sys/sys/lwp.h between version 1.98 and 1.98.2.4

version 1.98, 2008/06/02 13:58:07 version 1.98.2.4, 2008/07/28 14:37:37
Line 57 
Line 57 
  * l:   *l_mutex   * l:   *l_mutex
  * p:   l_proc->p_lock   * p:   l_proc->p_lock
  * s:   spc_mutex, which may or may not be referenced by l_mutex   * s:   spc_mutex, which may or may not be referenced by l_mutex
  * t:   l_proc->p_stmutex  
  * S:   l_selcpu->sc_lock   * S:   l_selcpu->sc_lock
  * (:   unlocked, stable   * (:   unlocked, stable
  * !:   unlocked, may only be reliably accessed by the LWP itself   * !:   unlocked, may only be reliably accessed by the LWP itself
Line 96  struct lwp {
Line 95  struct lwp {
         SLIST_HEAD(, turnstile) l_pi_lenders; /* l: ts lending us priority */          SLIST_HEAD(, turnstile) l_pi_lenders; /* l: ts lending us priority */
         uint64_t        l_ncsw;         /* l: total context switches */          uint64_t        l_ncsw;         /* l: total context switches */
         uint64_t        l_nivcsw;       /* l: involuntary context switches */          uint64_t        l_nivcsw;       /* l: involuntary context switches */
         int             l_cpticks;      /* t: Ticks of CPU time */          u_int           l_cpticks;      /* (: Ticks of CPU time */
         fixpt_t         l_pctcpu;       /* t: %cpu during l_swtime */          fixpt_t         l_pctcpu;       /* p: %cpu during l_swtime */
         fixpt_t         l_estcpu;       /* l: cpu time for SCHED_4BSD */          fixpt_t         l_estcpu;       /* l: cpu time for SCHED_4BSD */
         psetid_t        l_psid;         /* l: assigned processor-set ID */          psetid_t        l_psid;         /* l: assigned processor-set ID */
         struct cpu_info *l_target_cpu;  /* l: target CPU to migrate */          struct cpu_info *l_target_cpu;  /* l: target CPU to migrate */
         kmutex_t        l_swaplock;     /* l: lock to prevent swapping */          kmutex_t        l_swaplock;     /* l: lock to prevent swapping */
         struct lwpctl   *l_lwpctl;      /* p: lwpctl block kernel address */          struct lwpctl   *l_lwpctl;      /* p: lwpctl block kernel address */
         struct lcpage   *l_lcpage;      /* p: lwpctl containing page */          struct lcpage   *l_lcpage;      /* p: lwpctl containing page */
         cpuset_t        l_affinity;     /* l: CPU set for affinity */          kcpuset_t       *l_affinity;    /* l: CPU set for affinity */
   
         /* Synchronisation */          /* Synchronisation */
         struct turnstile *l_ts;         /* l: current turnstile */          struct turnstile *l_ts;         /* l: current turnstile */
Line 265  void lwp_startup(lwp_t *, lwp_t *);
Line 264  void lwp_startup(lwp_t *, lwp_t *);
 int     lwp_locked(lwp_t *, kmutex_t *);  int     lwp_locked(lwp_t *, kmutex_t *);
 void    lwp_setlock(lwp_t *, kmutex_t *);  void    lwp_setlock(lwp_t *, kmutex_t *);
 void    lwp_unlock_to(lwp_t *, kmutex_t *);  void    lwp_unlock_to(lwp_t *, kmutex_t *);
 void    lwp_lock_retry(lwp_t *, kmutex_t *);  kmutex_t *lwp_lock_retry(lwp_t *, kmutex_t *);
 void    lwp_relock(lwp_t *, kmutex_t *);  void    lwp_relock(lwp_t *, kmutex_t *);
 int     lwp_trylock(lwp_t *);  int     lwp_trylock(lwp_t *);
 void    lwp_addref(lwp_t *);  void    lwp_addref(lwp_t *);
Line 281  void cpu_setfunc(lwp_t *, void (*)(void 
Line 280  void cpu_setfunc(lwp_t *, void (*)(void 
 void    startlwp(void *);  void    startlwp(void *);
 void    upcallret(lwp_t *);  void    upcallret(lwp_t *);
 void    lwp_exit(lwp_t *) __dead;  void    lwp_exit(lwp_t *) __dead;
 void    lwp_exit_switchaway(lwp_t *);  void    lwp_exit_switchaway(lwp_t *) __dead;
 lwp_t *proc_representative_lwp(struct proc *, int *, int);  
 int     lwp_suspend(lwp_t *, lwp_t *);  int     lwp_suspend(lwp_t *, lwp_t *);
 int     lwp_create1(lwp_t *, const void *, size_t, u_long, lwpid_t *);  int     lwp_create1(lwp_t *, const void *, size_t, u_long, lwpid_t *);
 void    lwp_update_creds(lwp_t *);  void    lwp_update_creds(lwp_t *);
Line 319  void lwp_whatis(uintptr_t, void (*)(cons
Line 317  void lwp_whatis(uintptr_t, void (*)(cons
 static inline void  static inline void
 lwp_lock(lwp_t *l)  lwp_lock(lwp_t *l)
 {  {
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)  
         kmutex_t *old;          kmutex_t *old;
   
         mutex_spin_enter(old = l->l_mutex);          mutex_spin_enter(old = l->l_mutex);
Line 330  lwp_lock(lwp_t *l)
Line 327  lwp_lock(lwp_t *l)
          */           */
         if (__predict_false(l->l_mutex != old))          if (__predict_false(l->l_mutex != old))
                 lwp_lock_retry(l, old);                  lwp_lock_retry(l, old);
 #else  
         mutex_spin_enter(l->l_mutex);  
 #endif  
 }  }
   
 /*  /*
Line 442  CURCPU_IDLE_P(void)
Line 436  CURCPU_IDLE_P(void)
   
 /*  /*
  * Disable and re-enable preemption.  Only for low-level kernel   * Disable and re-enable preemption.  Only for low-level kernel
  * use.  Code outside kern/ should use kpreempt_disable() and   * use.  Device drivers and anything that could potentially be
    * compiled as a module should use kpreempt_disable() and
  * kpreempt_enable().   * kpreempt_enable().
  */   */
 static inline void  static inline void

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.98.2.4

CVSweb <webmaster@jp.NetBSD.org>