6 * @brief Process management definitions
10 /** maximum number of processes on one node */
13 /** maximum number of waiting messages */
14 #define MAXMSGQUEUE 16
16 /** message length defined by me (PS) */
22 * @brief Process states
25 /* during generation of process object */
28 /** non-active process (suspended by STOP) */
31 /** active process (ready to execute) */
34 /** waiting for NEW of another process */
37 /** waiting for remote procedure call */
40 /** during execution of ACCEPT statement */
43 /** waiting for process prototype */
47 /** Process descriptor */
50 /* TRUE if in use by some process */
53 /* process mark for proper detecting of none */
59 /* process prototype number */
62 /* pointer to memory array */
65 union value param[MAXPARAM];
67 /* instruction counter */
70 /* trace line number */
73 /* first word of object area */
76 /* last word in memory */
79 /* last word used by objects */
82 /* first word used by dictionary */
85 /* head of free dictionary item list */
88 /* head of killed object list for size > 2 */
91 /* head of killed object list for size = 2 */
94 /* am of process object */
97 /* process object virtual address */
100 /* remote process or procedure template */
103 /* pointers to current object */
106 /* adress of object just left */
109 /* used for LBLOCK1, LBLOCK2, LBLOCK3 */
112 /* queue of messages for this process */
115 /* queue of disabled RPC messages */
118 /* stack of set of enabled remote procedures */
121 /* next allocate will forace compact */
122 bool force_compactification;
124 /* table of pointers to processes in process */
132 * \defgroup MessageType Message type
138 /** resume request */
140 /** create new process request */
142 /** create process acknowledge */
146 /** remote procedure call request */
148 /** remote procedure return */
150 /** ask for process prototype */
152 /** answer with process prototype */
165 /** address of the sender and */
168 /** receiver of the message */
174 /** prototype or error signal number */
178 #define MAXPROCPAR (MSGLENGTH-sizeof(struct ctrlmsg))
182 struct ctrlmsg control;
183 char params[MAXPROCPAR];
186 /* Direction of copying of parameters (for moveparams()): */
193 /** process descriptor table */
194 extern procdescr process[];
196 /** pointer to current process descriptor */
197 extern procdescr *thisp;
199 /** current process index */
202 /** Round-Robin queue of ready processes */
205 /** TRUE if operating in D-Link network */
208 /** queue of waiting messages */
209 extern message globmsgqueue[];
211 /** number of waiting messages */
214 /** pointers to message queue */
215 extern int msghead, msgtail;
217 /** this machine node number */
220 /** console node number */
223 /** TRUE if remote node */
226 /** TRUE if rescheduling is mandatory */
227 extern bool reschedule;
230 /** pointer to Global Info Segment */
231 extern PGINFOSEG ginf;
236 #ifndef NO_PROTOTYPES
237 void obj2mess(word *,virtaddr *,procaddr*);
238 void mess2obj(procdescr *,procaddr *,virtaddr*);
239 bool isprocess(virtaddr *);
240 void hash_find(procaddr *,virtaddr *);
241 void hash_create(procdescr *,int);
242 void hash_set(procaddr *,word);