|
|
1.1 ! root 1: #include <CC/tty.h> ! 2: #ifndef PROC_H ! 3: #define PROC_H ! 4: ! 5: extern int NPROC; ! 6: #define STKSIZ (4096-sizeof(struct _*)) ! 7: #define CBSIZE 64 /* NPROC*CBSIZE <= queue.h/NCHARS */ ! 8: ! 9: #ifndef QUEUE_H ! 10: struct cbuf { /* duplicated from queue.h for simplicity */ ! 11: struct cbuf *next; ! 12: short word; ! 13: }; ! 14: struct clist { ! 15: struct cbuf *c_tail; ! 16: struct cbuf *c_head; ! 17: short c_cc; ! 18: short state; ! 19: }; ! 20: #endif ! 21: struct Pcb { ! 22: int psw; ! 23: char (*pc)(); ! 24: int sp; ! 25: int lower; ! 26: int upper; ! 27: int ap; ! 28: int fp; ! 29: int reg[9]; /* 9 user registers */ ! 30: int blkmv; ! 31: }; ! 32: struct Proc { ! 33: struct Pcb pcb; ! 34: char *text; ! 35: char *data; ! 36: char *bss; ! 37: int state; ! 38: Layer * layer; ! 39: Rectangle rect; /* rectangle on screen */ ! 40: struct clist kbdqueue; ! 41: char **traploc; ! 42: int *traptype; ! 43: int nticks; ! 44: Texture * cursor; ! 45: short inhibited; ! 46: short nchars; ! 47: unsigned char cbuf[CBSIZE*3]; /* circular buffer */ ! 48: unsigned char *cbufpin, *cbufpout; ! 49: struct Ttychars ttychars; /* chars for tty driver emulation */ ! 50: int stack[STKSIZ/sizeof(int)]; /* int for alignment */ ! 51: struct Font *defaultfont; ! 52: }; ! 53: ! 54: ! 55: #ifndef MUX_H ! 56: # ifdef TASK_C ! 57: struct Proc *newproc(); ! 58: # else ! 59: extern struct Proc *newproc(); ! 60: # endif ! 61: extern struct Proc *P; ! 62: extern struct Proc proctab[]; ! 63: #endif ! 64: ! 65: #ifdef MUXTERM ! 66: /* ! 67: * Data at start of user program ! 68: */ ! 69: struct udata { ! 70: Rectangle Drect; ! 71: Layer * Jdisplayp; ! 72: int argc; ! 73: char **argv; ! 74: struct Mouse mouse; ! 75: }; ! 76: /* states */ ! 77: #define RUN 1 /* ready to be scheduled */ ! 78: #define BUSY 2 /* active */ ! 79: #define BLOCKED 4 /* blocked by user with ^S */ ! 80: #define USER 8 /* a user-68ld'd process */ ! 81: #define KBDLOCAL 16 /* has requested the KBD */ ! 82: #define MOUSELOCAL 32 /* has requested the MOUSE */ ! 83: #define GOTMOUSE 64 /* currently owns MOUSE */ ! 84: #define WAKEUP 128 /* tell CONTROL to issue setrun(p) */ ! 85: #define MOVED 256 /* layer got moved */ ! 86: #define UNBLOCKED 512 /* Has been unblocked */ ! 87: #define ZOMBIE 1024 /* proc died horribly; waiting for debugger */ ! 88: #define RESHAPED 2048 /* layer got reshaped */ ! 89: #define ZOMBOOT 4096 /* put in ZOMBIE state after booting */ ! 90: #define ALARMREQD 8192 /* has requested an alarm */ ! 91: ! 92: #define setrun(p) ((p)->state|=RUN) ! 93: #define setnorun(p) ((p)->state&=~RUN) ! 94: ! 95: #else ! 96: #define MOVED 256 /* layer got moved */ ! 97: #define RESHAPED 2048 /* layer got reshaped */ ! 98: #endif MUXTERM ! 99: #endif PROC_H
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.