Deleted Added
full compact
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
52#ifdef KERNEL
53#include "opt_smp.h"
54#include <machine/smp.h>
55#endif
56
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 */
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 */
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 */
279extern struct proc *curproc; /* Current running proc. */
280#endif /* SMP */
281
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. */
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 ---