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