proc.h (24697) | proc.h (25164) |
---|---|
1/*- 2 * Copyright (c) 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)proc.h 8.15 (Berkeley) 5/19/95 | 1/*- 2 * Copyright (c) 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)proc.h 8.15 (Berkeley) 5/19/95 |
39 * $Id: proc.h,v 1.34 1997/04/07 07:16:02 peter Exp $ | 39 * $Id: proc.h,v 1.35 1997/04/07 09:35:15 peter Exp $ |
40 */ 41 42#ifndef _SYS_PROC_H_ 43#define _SYS_PROC_H_ 44 45#include <machine/proc.h> /* Machine-dependent proc substruct. */ 46#include <sys/rtprio.h> /* For struct rtprio. */ 47#include <sys/select.h> /* For struct selinfo. */ 48#include <sys/time.h> /* For structs itimerval, timeval. */ 49#include <sys/queue.h> 50#include <sys/param.h> 51 | 40 */ 41 42#ifndef _SYS_PROC_H_ 43#define _SYS_PROC_H_ 44 45#include <machine/proc.h> /* Machine-dependent proc substruct. */ 46#include <sys/rtprio.h> /* For struct rtprio. */ 47#include <sys/select.h> /* For struct selinfo. */ 48#include <sys/time.h> /* For structs itimerval, timeval. */ 49#include <sys/queue.h> 50#include <sys/param.h> 51 |
52#ifdef KERNEL 53#include "opt_smp.h" 54#include <machine/smp.h> 55#endif 56 |
|
52/* 53 * One structure allocated per session. 54 */ 55struct session { 56 int s_count; /* Ref cnt; pgrps in session. */ 57 struct proc *s_leader; /* Session leader. */ 58 struct vnode *s_ttyvp; /* Vnode of controlling terminal. */ 59 struct tty *s_ttyp; /* Controlling terminal. */ --- 73 unchanged lines hidden (view full) --- 133 int p_traceflag; /* Kernel trace points. */ 134 struct vnode *p_tracep; /* Trace to vnode. */ 135 136 int p_siglist; /* Signals arrived but not delivered. */ 137 138 struct vnode *p_textvp; /* Vnode of executable. */ 139 140 char p_lock; /* Process lock (prevent swap) count. */ | 57/* 58 * One structure allocated per session. 59 */ 60struct session { 61 int s_count; /* Ref cnt; pgrps in session. */ 62 struct proc *s_leader; /* Session leader. */ 63 struct vnode *s_ttyvp; /* Vnode of controlling terminal. */ 64 struct tty *s_ttyp; /* Controlling terminal. */ --- 73 unchanged lines hidden (view full) --- 138 int p_traceflag; /* Kernel trace points. */ 139 struct vnode *p_tracep; /* Trace to vnode. */ 140 141 int p_siglist; /* Signals arrived but not delivered. */ 142 143 struct vnode *p_textvp; /* Vnode of executable. */ 144 145 char p_lock; /* Process lock (prevent swap) count. */ |
141 char p_pad2[3]; /* alignment */ | 146 char p_oncpu; /* Which cpu we are on */ 147 char p_lastcpu; /* Last cpu we were on */ 148 char p_pad2; /* alignment */ |
142 143 char *p_selbits; /* For select(), bits */ 144 u_int p_selbits_size; /* For select(), fd_set size (bytes) */ 145 146 short p_locks; /* DEBUG: lockmgr count of held locks */ 147 short p_simple_locks; /* DEBUG: count of held simple locks */ 148 149/* End area that is zeroed on creation. */ --- 63 unchanged lines hidden (view full) --- 213#define P_NOSWAP 0x08000 /* Another flag to prevent swap out. */ 214#define P_PHYSIO 0x10000 /* Doing physical I/O. */ 215 216/* Should be moved to machine-dependent areas. */ 217#define P_OWEUPC 0x20000 /* Owe process an addupc() call at next ast. */ 218 219#define P_SWAPPING 0x40000 /* Process is being swapped. */ 220#define P_SWAPINREQ 0x80000 /* Swapin request due to wakeup */ | 149 150 char *p_selbits; /* For select(), bits */ 151 u_int p_selbits_size; /* For select(), fd_set size (bytes) */ 152 153 short p_locks; /* DEBUG: lockmgr count of held locks */ 154 short p_simple_locks; /* DEBUG: count of held simple locks */ 155 156/* End area that is zeroed on creation. */ --- 63 unchanged lines hidden (view full) --- 220#define P_NOSWAP 0x08000 /* Another flag to prevent swap out. */ 221#define P_PHYSIO 0x10000 /* Doing physical I/O. */ 222 223/* Should be moved to machine-dependent areas. */ 224#define P_OWEUPC 0x20000 /* Owe process an addupc() call at next ast. */ 225 226#define P_SWAPPING 0x40000 /* Process is being swapped. */ 227#define P_SWAPINREQ 0x80000 /* Swapin request due to wakeup */ |
228#define P_IDLEPROC 0x100000 /* Process is an idle-eater, don't count */ |
|
221 222/* 223 * MOVE TO ucred.h? 224 * 225 * Shareable process credentials (always resident). This includes a reference 226 * to the current user credentials as well as real and saved ids that may be 227 * used to change ids. 228 */ --- 31 unchanged lines hidden (view full) --- 260#define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) 261extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; 262extern u_long pidhash; 263 264#define PGRPHASH(pgid) (&pgrphashtbl[(pgid) & pgrphash]) 265extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl; 266extern u_long pgrphash; 267 | 229 230/* 231 * MOVE TO ucred.h? 232 * 233 * Shareable process credentials (always resident). This includes a reference 234 * to the current user credentials as well as real and saved ids that may be 235 * used to change ids. 236 */ --- 31 unchanged lines hidden (view full) --- 268#define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) 269extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; 270extern u_long pidhash; 271 272#define PGRPHASH(pgid) (&pgrphashtbl[(pgid) & pgrphash]) 273extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl; 274extern u_long pgrphash; 275 |
276#ifdef SMP 277#define curproc (SMPcurproc[cpunumber()]) 278#else /* !SMP */ |
|
268extern struct proc *curproc; /* Current running proc. */ | 279extern struct proc *curproc; /* Current running proc. */ |
280#endif /* SMP */ 281 |
|
269extern struct proc proc0; /* Process slot for swapper. */ 270extern int nprocs, maxproc; /* Current and max number of procs. */ 271extern int maxprocperuid; /* Max procs per uid. */ 272 273LIST_HEAD(proclist, proc); 274extern struct proclist allproc; /* List of all processes. */ 275extern struct proclist zombproc; /* List of zombie processes. */ 276extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */ 277 278#define NQS 32 /* 32 run queues. */ 279extern struct prochd qs[]; 280extern struct prochd rtqs[]; 281extern struct prochd idqs[]; 282extern int whichqs; /* Bit mask summary of non-empty Q's. */ | 282extern struct proc proc0; /* Process slot for swapper. */ 283extern int nprocs, maxproc; /* Current and max number of procs. */ 284extern int maxprocperuid; /* Max procs per uid. */ 285 286LIST_HEAD(proclist, proc); 287extern struct proclist allproc; /* List of all processes. */ 288extern struct proclist zombproc; /* List of zombie processes. */ 289extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */ 290 291#define NQS 32 /* 32 run queues. */ 292extern struct prochd qs[]; 293extern struct prochd rtqs[]; 294extern struct prochd idqs[]; 295extern int whichqs; /* Bit mask summary of non-empty Q's. */ |
296extern int whichrtqs; /* Bit mask summary of non-empty Q's. */ 297extern int whichidqs; /* Bit mask summary of non-empty Q's. */ |
|
283struct prochd { 284 struct proc *ph_link; /* Linked list of running processes. */ 285 struct proc *ph_rlink; 286}; 287 288struct proc *pfind __P((pid_t)); /* Find process by id. */ 289struct pgrp *pgfind __P((pid_t)); /* Find process group by id. */ 290 --- 27 unchanged lines hidden --- | 298struct prochd { 299 struct proc *ph_link; /* Linked list of running processes. */ 300 struct proc *ph_rlink; 301}; 302 303struct proc *pfind __P((pid_t)); /* Find process by id. */ 304struct pgrp *pgfind __P((pid_t)); /* Find process group by id. */ 305 --- 27 unchanged lines hidden --- |