4 /* Process management definitions : */
\r
6 #define MAXPROCESS 64 /* maximum number of processes on one node */
\r
7 #define MAXMSGQUEUE 16 /* maximum number of waiting messages */
\r
10 #define MSGLENGTH 80 /* message length defined by D-Link driver */
\r
12 #define MSGLENGTH 256 /* message length defined by me (PS) */
\r
14 #define MSGLENGTH 256 /* message length defined by me (PS) */
\r
18 /* Process state : */
\r
20 #define GENERATING 0 /* during generation of process object */
\r
21 #define STOPPED 1 /* non-active process (suspended by STOP) */
\r
22 #define EXECUTING 2 /* active process (ready to execute) */
\r
23 #define WAITFORNEW 3 /* waiting for NEW of another process */
\r
24 #define WAITFORRPC 4 /* waiting for remote procedure call */
\r
25 #define ACCEPTING 5 /* during execution of ACCEPT statement */
\r
26 #define WAITASKPRO 6 /* waiting for process prototype */
\r
28 /* Process descriptor : */
\r
32 bool used; /* TRUE if in use by some process */
\r
33 word mark; /* process mark for proper detecting of none */
\r
34 int status; /* process state */
\r
35 word prot; /* process prototype number */
\r
36 memory M; /* pointer to memory array */
\r
37 union value param[ MAXPARAM ];
\r
38 word ic; /* instruction counter */
\r
39 word trlnumber; /* trace line number */
\r
40 word lower; /* first word of object area */
\r
41 word upper; /* last word in memory */
\r
42 word lastused; /* last word used by objects */
\r
43 word lastitem; /* first word used by dictionary */
\r
44 word freeitem; /* head of free dictionary item list */
\r
45 word headk; /* head of killed object list for size > 2 */
\r
46 word headk2; /* head of killed object list for size = 2 */
\r
47 word prochead; /* am of process object */
\r
48 virtaddr procref; /* process object virtual address */
\r
49 virtaddr template; /* remote process or procedure template */
\r
50 word c1, c2; /* pointers to current object */
\r
51 virtaddr backobj; /* adress of object just left */
\r
52 word blck1, blck2; /* used for LBLOCK1, LBLOCK2, LBLOCK3 */
\r
53 queue msgqueue; /* queue of messages for this process */
\r
54 queue rpcwait; /* queue of disabled RPC messages */
\r
55 stack rpcmask; /* stack of set of enabled remote procedures */
\r
56 bool force_compactification; /* next allocate will forace compact... */
\r
57 word *hash; /* table of pointers to processes in process */
\r
62 /* Message type : */
\r
64 #define ERRSIG 0 /* error signal */
\r
65 #define RESUME 1 /* resume request */
\r
66 #define CREATE 2 /* create new process request */
\r
67 #define CREACK 3 /* create process acknowledge */
\r
68 #define KILLPR 4 /* kill process */
\r
69 #define RPCALL 5 /* remote procedure call request */
\r
70 #define RPCACK 6 /* remote procedure return */
\r
71 #define ASKPRO 7 /* ask for process prototype */
\r
72 #define PROACK 8 /* answer with process prototype */
\r
82 procaddr sender; /* address of the sender and */
\r
83 procaddr receiver; /* receiver of the message */
\r
84 int type; /* message type */
\r
85 int par; /* prototype or error signal number */
\r
88 #define MAXPROCPAR (MSGLENGTH-sizeof(struct ctrlmsg))
\r
92 struct ctrlmsg control;
\r
93 char params[ MAXPROCPAR ];
\r
96 /* Direction of copying of parameters (for moveparams()) : */
\r
101 typedef char *mask;
\r
103 extern procdescr process[]; /* process descriptor table */
\r
104 extern procdescr *thisp; /* pointer to current process descriptor */
\r
105 extern word thispix; /* current process index */
\r
106 extern queue ready; /* Round-Robin queue of ready processes */
\r
107 extern bool network; /* TRUE if operating in D-Link network */
\r
108 extern message globmsgqueue[]; /* queue of waiting messages */
\r
109 extern int msgready; /* number of waiting messages */
\r
110 extern int msghead, msgtail; /* pointers to message queue */
\r
111 extern word ournode; /* this machine node number */
\r
112 extern word console; /* console node number */
\r
113 extern bool remote; /* TRUE if remote node */
\r
114 extern bool reschedule; /* TRUE if rescheduling is mandatory */
\r
117 extern PGINFOSEG ginf; /* pointer to Global Info Segment */
\r
122 #ifndef NO_PROTOTYPES
\r
123 void obj2mess(word *,virtaddr *,procaddr*);
\r
124 void mess2obj(procdescr *,procaddr *,virtaddr*);
\r
125 bool isprocess(virtaddr *);
\r
126 void hash_find(procaddr *,virtaddr *);
\r
127 void hash_create(procdescr *,int);
\r
128 void hash_set(procaddr *,word);
\r
134 void hash_create();
\r