| 1 | #define NGROUPS 10 |
| 2 | #define NCHANS 20 |
| 3 | |
| 4 | #define DCHAN 1 |
| 5 | #define CCHAN 0 |
| 6 | |
| 7 | struct chan { |
| 8 | short c_flags; |
| 9 | char c_index; |
| 10 | char c_msg; |
| 11 | struct group *c_group; |
| 12 | struct tty *c_ttyp; |
| 13 | struct file *c_fy; |
| 14 | int c_pgrp; |
| 15 | union { |
| 16 | struct clist datq; |
| 17 | } cx; |
| 18 | union { |
| 19 | struct clist datq; |
| 20 | struct chan *c_chan; |
| 21 | } cy; |
| 22 | struct clist c_ctlx; |
| 23 | struct clist c_ctly; |
| 24 | }; |
| 25 | |
| 26 | |
| 27 | struct group { |
| 28 | short g_state; |
| 29 | char g_mindex; |
| 30 | short g_index; |
| 31 | short g_count; |
| 32 | struct inode *g_inode; |
| 33 | struct group *g_master; |
| 34 | struct clist g_cntl; |
| 35 | struct clist g_datq; |
| 36 | }; |
| 37 | |
| 38 | /* |
| 39 | * flags |
| 40 | */ |
| 41 | #define INUSE 01 |
| 42 | #define COPEN 02 |
| 43 | #define XGRP 04 |
| 44 | #define YGRP 010 |
| 45 | #define WCLOSE 020 |
| 46 | #define TTYO 040 |
| 47 | #define SUBGRP 0100 |
| 48 | #define BLOCK 0200 |
| 49 | #define BLOCK1 0400 |
| 50 | #define SIGBLK 01000 |
| 51 | #define BLKMSG 01000 |
| 52 | #define ENAMSG 02000 |
| 53 | #define WFLUSH 04000 |
| 54 | #define RZERO 010000 |
| 55 | |
| 56 | |
| 57 | /* |
| 58 | * mpxchan command codes |
| 59 | */ |
| 60 | #define GROUP 5 |
| 61 | #define GROUPN 6 |
| 62 | #define CHAN 1 |
| 63 | #define JOIN 2 |
| 64 | #define EXTR 3 |
| 65 | #define ATTACH 4 |
| 66 | #define CONNECT 7 |
| 67 | #define DETACH 8 |
| 68 | #define DISCON 9 |
| 69 | #define DEBUG 10 |
| 70 | #define NPGRP 11 |
| 71 | #define CSIG 12 |
| 72 | #define PACK 13 |
| 73 | |
| 74 | #define NDEBUGS 30 |
| 75 | /* |
| 76 | * control channel message codes |
| 77 | */ |
| 78 | #define WATTCH 1 |
| 79 | #define M_WATCH 1 |
| 80 | #define SCLOSE 2 |
| 81 | #define M_CLOSE 2 |
| 82 | #define M_ATTACH 3 |
| 83 | #define M_BLK 4 |
| 84 | #define M_UBLK 5 |
| 85 | #define DO_BLK 6 |
| 86 | #define DO_UBLK 7 |
| 87 | #define M_XINT 8 |
| 88 | #define M_RINT 9 |
| 89 | #define M_ACK 10 |
| 90 | #define M_NAK\e 11 |
| 91 | |
| 92 | |
| 93 | /* |
| 94 | * debug codes other than mpxchan cmds |
| 95 | */ |
| 96 | #define MCCLOSE 29 |
| 97 | #define MCOPEN 28 |
| 98 | #define ALL 27 |
| 99 | #define SCON 26 |
| 100 | #define MSREAD 25 |
| 101 | #define SDATA 24 |
| 102 | #define MCREAD 23 |
| 103 | #define MCWRITE 22 |
| 104 | |
| 105 | /* HDRSIZE == NLEVELS + sizeof (short) */ |
| 106 | #define HDRSIZE 4 |
| 107 | #define NLEVELS 2 |
| 108 | union u_index { |
| 109 | short val; |
| 110 | char bytes[NLEVELS]; |
| 111 | }; |
| 112 | typedef union u_index index_t; |