|
|
1.1 root 1: /* Copyright (c) 1987 AT&T */
2: /* All Rights Reserved */
3:
4: /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
5: /* The copyright notice above does not evidence any */
6: /* actual or intended publication of such source code. */
7:
8: #include <sccsid.h>
9: HVERSION(dmdproc, @(#)dmdproc.h 1.1.1.8 (5/10/87));
10:
11: #ifndef PROC_H
12: #define PROC_H 1
13:
14: #define NPROC 8 /* caution - this is repeated in io.h -
15: total xt connections to a host */
16: #define STKSIZE ((unsigned long)2048) /* default per-process stack size */
17: #define MAGIC 0xaaaaaaaa /* magic number for stack overflow check */
18: #define CBSIZE 64 /* NPROC*CBSIZE <= queue.h/NCHARS */
19: #define IO_Q_SIZE 512 /* queue size interrupt handlers use */
20: #define RCVQBUFSIZE (CBSIZE*3) /* size of per process receive queue */
21: #define KBDQBUFSIZE 128 /* size of kbdqueue */
22:
23: typedef struct Queue {
24: unsigned char *first; /* position before first character */
25: unsigned char *last; /* pointer to last character */
26: unsigned char *array; /* address of start of circular buffer */
27: unsigned char *array_last; /* address of end of circular buffer */
28: unsigned short c_cc; /* characters currently in the queue */
29: unsigned short size; /* size of the queue */
30: unsigned short ipl; /* ipl for this queue - not currently used */
31: long pad[2]; /* for the future */
32: } Queue;
33:
34: typedef struct Timer {
35: unsigned long waketime; /* time to wake up */
36: int (*tfire)(); /* control executes this when alarm fires */
37: long targ; /* unique argument to the above function */
38: struct Timer *tnext; /* links to the next Timer */
39: } Timer;
40:
41: typedef struct Proc {
42: long *sp; /* stack pointer (really frame pointer) */
43: char *text; /* address of text */
44: char *data; /* address of data */
45: char *bss; /* address of bss */
46: long state; /* see definitions below */
47: long state2; /* for the future */
48: long state3; /* for the future */
49: long appl; /* for applications to use (wproc uses it) */
50: Rectangle uDrect; /* application's Drect */
51: Bitmap *uJdisplayp; /* application's display */
52: int uargc; /* application's argc */
53: char **uargv; /* application's argv */
54: struct Mouse umouse; /* application's mouse */
55: Point (*ctob)(); /* characters to bits, args are (x,y,P) */
56: Point (*btoc)(); /* bits to characters, args are (x,y,P) */
57: long pad1[8]; /* for the future */
58: struct Logio *host; /* logical host device for this proc */
59: struct Layer *layer; /* layer structure for this process */
60: long caches; /* what caches this process has requested objects from */
61: struct Msqid_q *msqid_q;/* link list of message queue id's */
62: long pad2[6]; /* for the future */
63: Rectangle rect; /* rectangle on screen (Drect) */
64: long pad3[4]; /* for the future */
65: long traploc; /* for the debugger */
66: short traptype; /* for the debugger */
67: long pad4[3]; /* more pad */
68: Point scurpt; /* Current pt as offset from Drect.origin in
69: screen coordinates for printf, etc. */
70: Point curpt; /* Current pt in layer coordinates for the
71: jline etc. crowd */
72: Timer timer; /* timer for this process, used for alarm */
73: long pad5[4]; /* more pad */
74: Texture16 *cursor; /* mouse cursor for this process */
75: short inhibited; /* stack for cursor tracking */
76: long pad6[12]; /* for the future */
77: struct Proc *nextproc; /* next process in the linked list */
78: short xtchan; /* xt channel this process is connected to */
79: Queue kbdqueue; /* kbd queue for processes who requested kbd */
80: long pad7[12]; /* more pad */
81: int kbd_LEDs; /* per process keyboard LED status */
82: char enterkey[6]; /* per process definition for the enter key */
83: Queue rcvq; /* per process receive character queue */
84: long pad8[6]; /* for the future */
85: int *stack; /* pointer to per process stack - int for alignment */
86: unsigned long stksize; /* size of stack pointed to by stack */
87: long pad9[12]; /* for the future */
88: unsigned char kbdqueue_buf[KBDQBUFSIZE]; /* buffer for kbdqueue */
89: unsigned char rcvq_buf[RCVQBUFSIZE]; /* buffer for rcvq */
90: } Proc;
91:
92:
93: #define PROCSTATES
94:
95:
96: #ifdef MPXTERM
97: #define PROCSTATES
98: #endif
99: #ifdef PANDORA
100: #define PROCSTATES
101: #endif
102:
103: #ifdef DMODEL
104: #define PROCSTATES
105: #endif
106:
107: #ifdef PROCSTATES
108: /*
109: * Data at start of user program.
110: * This has been put into the Proc structure.
111: *
112: *struct udata {
113: * Rectangle Drect;
114: * struct Layer * Jdisplayp;
115: * int argc;
116: * char **argv;
117: * struct Mouse mouse;
118: *};
119: */
120:
121: /*
122: * if(P->host == LOCAL) process has no host connection
123: */
124: #define LOCAL (struct Logio *)0
125:
126: /*
127: * states
128: */
129: #define RUN 0x1 /* ready to be scheduled */
130: #define OKTOUNBLK 0x2 /* ready to unblock a BLOCKED process */
131: #define BLOCKED 0x4 /* blocked by user with ^S */
132: #define USER 0x8 /* a user-32ld'd process */
133: #define KBDLOCAL 0x10 /* has requested the KBD */
134: #define MOUSELOCAL 0x20 /* has requested the MOUSE */
135: #define GOTMOUSE 0x40 /* currently owns MOUSE */
136: #define WAKEUP 0x80 /* indicate an alarm has fired */
137: #define MOVED 0x100 /* layer got moved */
138: #define UNBLOCKED 0x200 /* Has been unblocked */
139: #define ZOMBIE 0x400 /* proc died horribly; waiting for debugger */
140: #define RESHAPED 0x800 /* layer got reshaped */
141: #define ZOMBOOT 0x1000 /* put in ZOMBIE state after booting */
142: #define ALARMREQD 0x2000 /* has requested an alarm */
143: #define LOCKLAYER 0x4000 /* can't delete layer with mouse */
144: #define NOPFEXPAND 0x8000 /* do not expand the PF keys */
145: #define NOPADEXPAND 0x10000 /* do not expand right key pad */
146: #define NOCURSEXPAND 0x20000 /* do not expand arrow keys and HOME key */
147: #define NOTRANSLATE 0x40000 /* send keyboard raw codes to process */
148: #define SCR_LOCK 0x80000 /* process is scroll locked */
149: #define LABEL 0x100000 /* process has a label area */
150: #define NO_RESHAPE 0x200000 /* window is not reshapable */
151: #define CURSXY_ONLY 0x400000 /* mouse move along xy axes only */
152: #define RESHAPE_OK 0x800000 /* reshape to fixed size ok */
153: #define MODCURRENT 0x1000000 /* current state gets changed */
154: #define SCRLOCKREQD 0x2000000 /* do scroll lock led and label bar */
155: #define USERDELETE 0x4000000 /* user tried to delete LOCKLAYER'ed layer */
156: #define DONTCRASH 0x8000000 /* don't generate an exeception message -
157: just zombie process - used by dmdpi agent */
158: #define MSG_WAKE 0x10000000/* message status has changed */
159:
160: #define setrun(p) ((p)->state|=RUN)
161: #define setnorun(p) ((p)->state&=~RUN)
162:
163: #else
164: #define MOVED 0x100 /* layer got moved */
165: #define RESHAPED 0x800 /* layer got reshaped */
166: #define LOCKLAYER 0x4000 /* can't delete layer with mouse */
167: #define NOPFEXPAND 0x8000 /* do not expand the PF keys */
168: #define NOPADEXPAND 0x10000 /* do not expand right key pad */
169: #define NOCURSEXPAND 0x20000 /* do not expand arrow keys and HOME key */
170: #define NOTRANSLATE 0x40000 /* send keyboard raw codes to process */
171: #define SCR_LOCK 0x80000 /* process is scroll locked */
172: #define SCRLOCKREQD 0x2000000 /* do scroll lock led and label bar */
173: #define USERDELETE 0x4000000 /* user tried to delete LOCKLAYER'ed layer */
174: #endif /* PROCSTATES */
175:
176:
177: #define INSET 4
178: #define NULLP (Proc *)0
179: #define PROCSIZ sizeof (Proc)
180: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.