|
|
1.1 root 1: /* proc.h - isbadpid */
2:
3: /* process table declarations and defined constants */
4:
5: #ifndef NPROC /* set the number of processes */
1.1.1.2 ! root 6: #define NPROC 10 /* allowed if not already done */
1.1 root 7: #endif
8:
9: /* process state constants */
10:
1.1.1.2 ! root 11: #define PRFREE '\01' /* process slot is free */
! 12: #define PRCURR '\02' /* process is currently running */
! 13: #define PRREADY '\03' /* process is on ready queue */
! 14: #define PRSUSP '\04' /* process is suspended */
! 15: #define PRRECV '\05' /* process waiting for message */
! 16: #define PRWAIT '\06' /* process is on semaphore queue*/
! 17: #define PRSLEEP '\07' /* process is sleeping */
1.1 root 18:
19: /* miscellaneous process definitions */
20:
1.1.1.2 ! root 21: #ifdef lsi11
! 22: #define PNREGS 8 /* size of saved register area */
1.1 root 23: #define PNMLEN 8 /* length of process "name" */
1.1.1.2 ! root 24:
! 25: #else
! 26: #define PNREGS 19 /* size of saved register area */
! 27: #define PNMLEN 16 /* length of process "name" */
! 28: #endif
! 29:
1.1 root 30: #define NULLPROC 0 /* id of the null process; it */
31: /* is always eligible to run */
32:
33: #define isbadpid(x) (x<=0 || x>=NPROC)
34:
35: /* process table entry */
36:
37: struct pentry {
1.1.1.2 ! root 38: SAVEDPS pstatreg; /* PS at time of call to disable*/
! 39: char phasps; /* nonzero iff pstateg is valid */
1.1 root 40: char pstate; /* process state: PRCURR, etc. */
41: char pname[PNMLEN]; /* process name */
1.1.1.2 ! root 42: int pprio; /* process priority */
! 43: int psem; /* semaphore if process waiting */
! 44: int pargs; /* initial number of arguments */
! 45: char phasmsg; /* nonzero iff pmsg is valid */
! 46: WORD pmsg; /* message sent to this process */
! 47: WORD pregs[PNREGS]; /* saved registers PC, and PS */
! 48: WORD paddr; /* initial code address */
! 49: WORD pbase; /* base of run time stack */
! 50: int pstklen; /* stack length */
! 51: WORD plimit; /* lowest extent of stack */
1.1 root 52: };
53:
54: extern struct pentry proctab[];
55: extern int numproc; /* currently active processes */
56: extern int nextproc; /* search point for free slot */
57: extern int currpid; /* currently executing process */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.