home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#) proc.h 2.6 88/07/13
- *
- * Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
- * Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
- * This Module contains Proprietary Information of
- * The Santa Cruz Operation, Microsoft Corporation
- * and AT&T, and should be treated as Confidential.
- */
-
- /*
- * One structure allocated per active process. It contains all data needed
- * about the process while the process may be swapped out.
- * Other per process data (user.h) is swapped with the process.
- */
-
- struct proc {
- char p_stat;
- #ifndef M_I386
- char p_flag;
- #endif
- char p_pri; /* priority, negative is high */
- char p_time; /* resident time for scheduling */
- char p_cpu; /* cpu usage for scheduling */
- char p_nice; /* nice for cpu usage */
- ushort p_uid; /* real user id */
- ushort p_suid; /* set (effective) user id */
- ushort p_sgid; /* set (effective) group id */
- short p_pgrp; /* name of process group leader */
- short p_pid; /* unique process id */
- short p_ppid; /* process id of parent */
- #ifdef M_I386
- unsigned int p_flag;
- #endif
- long p_sig; /* signals pending to this process */
- #ifdef M_I386
- int p_hold; /* hold signal bit mask */
- int p_chold; /* defer signal bit mask */
- /* sigset turns on this bit */
- /* signal does not turn on this bit */
- struct tabent p_addr[MAXUSIZE]; /* page table entries for u-area */
- int p_wsize; /* working set size */
- #define p_uaddr p_addr /* used by resume */
- #else
- union {
- unsigned short p_daddr; /* block number of u on swap */
- mloc_t p_caddr; /* location of p_usize region in core */
- } p_addr;
- #define p_uaddr p_addr.p_caddr /* used by resume */
- #endif
- unsigned short p_fcsel; /* first code selector */
- unsigned short p_fdsel; /* first data selector */
- unsigned short p_ldsel; /* last data selector */
- short p_tsize; /* size of text (used by exec/swapin) */
- short p_ssize; /* size of stack (used by exec/swapin) */
- unsigned short p_lsize; /* size in bytes of the ldt: 286 only */
- msize_t p_usize; /* size of u + ldts + ldtinfo seg: 286 only */
- #ifdef M_I386
- inodep_t p_iptr; /* pointer to inode of prototype */
- #else
- struct text *p_textp; /* pointer to text structure */
- #endif
- struct proc *p_link; /* linked list of running processes */
- union {
- caddr_t p_cad;
- int p_int;
- } p_unw;
- #define p_wchan p_unw.p_cad
- #define p_arg p_unw.p_int
- int p_clktim; /* time to alarm clock signal */
- struct sd *p_sdp; /* pointer to list of shared data segments */
- #ifdef M_I386
- caddr_t p_smbeg; /* start of shared data */
- caddr_t p_smend; /* last byte of shared data */
- #ifdef VPIX
- struct v86dat *p_v86; /* pointer to v86 structure */
- #else
- caddr_t p_v86; /* pointer to v86 structure */
- #endif
- int p_dummy0; /* reserved 0 */
- int p_dummy1; /* reserved 1 */
- int p_dummy2; /* reserved 2 */
- #endif
- };
-
- extern struct proc proc[]; /* the proc table itself */
-
- #ifdef M_I8086
- #define p_size p_usize /* re-use field for other purpose */
- #define p_cflags p_lsize
- #endif
-
- /* stat codes */
- #define SSLEEP 1 /* awaiting an event */
- #define SWAIT 2 /* (abandoned state) */
- #define SRUN 3 /* running */
- #define SIDL 4 /* intermediate state in process creation */
- #define SZOMB 5 /* intermediate state in process termination */
- #define SSTOP 6 /* process being traced */
- #define SXBRK 7 /* process being xswapped */
- #define SXSTK 8 /* process being xswapped */
- #define SXTXT 9 /* process being xswapped */
-
- /* flag codes */
- #define SLOAD 01 /* in core */
- #define SSYS 02 /* scheduling process */
- #define SLOCK 04 /* process cannot be swapped */
- #define SSWAP 010 /* process is being swapped out */
- #define STRC 020 /* process is being traced */
- #define SWTED 040 /* another tracing flag */
- #define STEXT 0100 /* text pointer valid */
- #define SSCAN 0200 /* process has been scanned since last swapin */
-
- #ifdef M_I386
- #define SPOLL 0400 /* process in stream poll */
- #define SSEL SPOLL /* or doing select() (see SPOLL) */
- #define SNWAKE 001000 /* Process cannot wakeup by a signal */
- #define SREQLK 0x10000 /* process requests it not be swapped */
- #define SHAD2SWP 0x20000 /* process swapped anyway, despite request */
- #define SPARTOUT 0x40000 /* tried to swap out, but had locked page */
- #endif
-
- /* contiguity flags */
- #define SCSTACK 01
- #define SCDATA 02
- #define SCWANT 04
- #define SCLDATA 010
- #define SCLTEXT 020
-
- /*
- * parallel proc structure
- * to replace part with times
- * to be passed to parent process
- * in ZOMBIE state.
- */
-
- struct xproc {
- char xp_stat;
- #ifndef M_I386
- char xp_flag;
- #endif
- char xp_pri; /* priority, negative is high */
- char xp_time; /* resident time for scheduling */
- char xp_cpu; /* cpu usage for scheduling */
- char xp_nice; /* nice for cpu usage */
- ushort xp_uid; /* real user id */
- ushort xp_suid; /* set (effective) user id */
- ushort xp_sgid; /* set (effective) group id */
- short xp_pgrp; /* name of process group leader */
- short xp_pid; /* unique process id */
- short xp_ppid; /* process id of parent */
- #ifdef M_I386
- unsigned int xp_flag;
- #endif
- long xp_sig; /* signals pending to this process */
- #ifdef M_I386
- int xp_hold; /* hold signal bit mask */
- int xp_chold; /* defer signal bit mask */
- /* sigset turns on this bit */
- /* signal does not turn on this bit */
- struct tabent xp_addr[MAXUSIZE]; /* page table entries for u-area */
- int xp_wsize; /* working set size */
- #else
- union {
- unsigned short xp_daddr;/* block number of u on swap */
- mloc_t xp_caddr;/* location of p_usize region in core */
- } xp_addr;
- #endif
- short xp_xstat; /* Exit status for wait */
- time_t xp_utime; /* user time, this proc */
- time_t xp_stime; /* system time, this proc */
- };
-
-