From 820547ce776e64d9bbf78d153509993b407a0f09 Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Fri, 18 Jul 1975 04:28:09 -0500 Subject: [PATCH] Research V6 development Work on file usr/sys/proc.h Co-Authored-By: Dennis Ritchie Synthesized-from: v6 --- usr/sys/proc.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 usr/sys/proc.h diff --git a/usr/sys/proc.h b/usr/sys/proc.h new file mode 100644 index 0000000000..34a1d3ba01 --- /dev/null +++ b/usr/sys/proc.h @@ -0,0 +1,42 @@ +/* + * 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; + char p_flag; + char p_pri; /* priority, negative is high */ + char p_sig; /* signal number sent to this process */ + char p_uid; /* user id, used to direct tty signals */ + char p_time; /* resident time for scheduling */ + char p_cpu; /* cpu usage for scheduling */ + char p_nice; /* nice for scheduling */ + int p_ttyp; /* controlling tty */ + int p_pid; /* unique process id */ + int p_ppid; /* process id of parent */ + int p_addr; /* address of swappable image */ + int p_size; /* size of swappable image (*64 bytes) */ + int p_wchan; /* event process is awaiting */ + int *p_textp; /* pointer to text structure */ +} proc[NPROC]; + +/* stat codes */ +#define SSLEEP 1 /* sleeping on high priority */ +#define SWAIT 2 /* sleeping on low priority */ +#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 */ + +/* 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 */ -- 2.20.1