0350: /*
0351: * One structure allocated per active
0352: * process. It contains all data needed
0353: * about the process while the
0354: * process may be swapped out.
0355: * Other per process data (user.h)
0356: * is swapped with the process.
0357: */
0358: struct proc
0359: {
0360: char p_stat;
0361: char p_flag;
0362: char p_pri; /* priority, negative is high */
0363: char p_sig; /* signal number sent to this process */
0364: char p_uid; /* user id, used to direct tty signals */
0365: char p_time; /* resident time for scheduling */
0366: char p_cpu; /* cpu usage for scheduling */
0367: char p_nice; /* nice for scheduling */
0368: int p_ttyp; /* controlling tty */
0369: int p_pid; /* unique process id */
0370: int p_ppid; /* process id of parent */
0371: int p_addr; /* address of swappable image */
0372: int p_size; /* size of swappable image (*64 bytes) */
0373: int p_wchan; /* event process is awaiting */
0374: int *p_textp; /* pointer to text structure */
0375:
0376: } proc[NPROC];
0377: /* --------------------------- */
0378:
0379: /* stat codes */
0380:
0381:
0382: #define SSLEEP 1 /* sleeping on high priority */
0383: #define SWAIT 2 /* sleeping on low priority */
0384: #define SRUN 3 /* running */
0385: #define SIDL 4 /* intermediate state in process creation */
0386: #define SZOMB 5 /* intermediate state in process termination */
0387: #define SSTOP 6 /* process being traced */
0388:
0389: /* flag codes */
0390:
0391: #define SLOAD 01 /* in core */
0392: #define SSYS 02 /* scheduling process */
0393: #define SLOCK 04 /* process cannot be swapped */
0394: #define SSWAP 010 /* process is being swapped out */
0395: #define STRC 020 /* process is being traced */
0396: #define SWTED 040 /* another tracing flag */