Annotation of researchv9/sys.vax/h/stream.h, revision 1.1.1.1

1.1       root        1: #define        QPCTL   0100            /* priority control message */
                      2: #define        QBSIZE  64              /* "standard" size of queue block*/
                      3: #define QBBSIZE 1024           /* size of a big queue block */
                      4: 
                      5: /*
                      6:  * data queue
                      7:  */
                      8: struct queue {
                      9:        struct  qinit   *qinfo;         /* procs and limits for queue */
                     10:        struct  block   *first;         /* first data block */
                     11:        struct  block   *last;          /* last data block */
                     12:        struct  queue   *next;          /* Q of next stream */
                     13:        struct  queue   *link;          /* to next Q for scheduling */
                     14:        caddr_t ptr;                    /* to private data structure */
                     15:        short   count;                  /* number of blocks on Q */
                     16:        u_short flag;
                     17: };
                     18: 
                     19: /* Queue flags */
                     20: #define        QENAB   01                      /* Queue is already enabled to run */
                     21: #define        QWANTR  02                      /* Someone wants to read Q */
                     22: #define        QWANTW  04                      /* Someone wants to write Q */
                     23: #define        QFULL   010                     /* Q is considered full */
                     24: #define        QREADR  020                     /* This is the reader (first) Q */
                     25: #define        QUSE    040                     /* This queue in use (allocation) */
                     26: #define        QNOENB  0100                    /* Don't enable Q via putq */
                     27: #define        QDELIM  0200                    /* This queue generates delimiters */
                     28: #define        QBIGB   0400                    /* This queue would like big blocks */
                     29: 
                     30: /*
                     31:  * queue information structure
                     32:  */
                     33: struct qinit {
                     34:        int     (*putp)();              /* put procedure */
                     35:        int     (*srvp)();              /* service procedure */
                     36:        long    (*qopen)();             /* called on startup */
                     37:        int     (*qclose)();            /* called on finish */
                     38:        short   limit;                  /* high water mark */
                     39:        short   lolimit;                /* low water mark */
                     40: };
                     41: 
                     42: #define        OTHERQ(q)       ((q)->flag&QREADR? (q)+1: (q)-1)
                     43: #define        WR(q)           (q+1)
                     44: #define        RD(q)           (q-1)
                     45: 
                     46: /*
                     47:  * Queue data block
                     48:  */
                     49: struct block {
                     50:        struct  block   *next;
                     51:        u_char  *rptr;
                     52:        u_char  *wptr;
                     53:        u_char  *lim;
                     54:        u_char  *base;
                     55:        char    type;
                     56:        char    class;
                     57: };
                     58: 
                     59: /*
                     60:  * Header for a stream: interface to rest of system
                     61:  */
                     62: struct stdata {
                     63:        struct  queue *wrq;             /* write queue */
                     64:        struct  block *iocblk;          /* return block for ioctl */
                     65:        struct  inode *inode;           /* backptr, for hangups */
                     66:        struct  proc *wsel;             /* process write-selecting */
                     67:        struct  proc *rsel;             /* process read-selecting */
                     68:        short   pgrp;                   /* process group, for signals */
                     69:        short   flag;
                     70:        char    count;                  /* # processes in stream routines */
                     71: };
                     72: #define        IOCWAIT 01                      /* Someone wants to do ioctl */
                     73: #define RSLEEP 02                      /* Someone wants to read */
                     74: #define        WSLEEP  04                      /* Someone wants to write */
                     75: #define        HUNGUP  010                     /* Device has vanished */
                     76: #define        RSEL    020                     /* read-select collision*/
                     77: #define        WSEL    040                     /* write-select collision */
                     78: #define        EXCL    0100                    /* exclusive-use (no opens) */
                     79: #define        STWOPEN 0200                    /* waiting for 1st open */
                     80: 
                     81: struct block   *getq();
                     82: int    putq();
                     83: struct block   *allocb();
                     84: struct queue   *backq();
                     85: struct queue   *allocq();
                     86: struct inode   *stopen();
                     87: 
                     88: /*
                     89:  * Control messages (regular priority)
                     90:  */
                     91: #define        M_DATA  0               /* regular data (not ctl) */
                     92: #define        M_BREAK 01              /* line break */
                     93: #define        M_HANGUP 02             /* line disconnect */
                     94: #define        M_DELIM 03              /* data delimiter */
                     95: #define        M_ECHO  04              /* request ACK (1 param) */
                     96: #define        M_ACK   05              /* response to ECHO (1 param) */
                     97: #define        M_IOCTL 06              /* ioctl; set/get params */
                     98: #define        M_DELAY 07              /* real-time xmit delay (1 param) */
                     99: #define        M_CTL   010             /* device-specific control message */
                    100: #define        M_PASS  011             /* pass file */
                    101: #define        M_YDEL  012             /* stream has started generating delims */
                    102: #define        M_NDEL  013             /* stream has stopped generating delims */
                    103: 
                    104: /*
                    105:  * Control messages (high priority; go to head of queue)
                    106:  */
                    107: #define        M_SIGNAL 0101           /* generate process signal */
                    108: #define        M_FLUSH 0102            /* flush your queues */
                    109: #define        M_STOP  0103            /* stop transmission immediately */
                    110: #define        M_START 0104            /* restart transmission after stop */
                    111: #define        M_IOCACK 0105           /* acknowledge ioctl */
                    112: #define        M_IOCNAK 0106           /* negative ioctl acknowledge */
                    113: #define        M_CLOSE 0107            /* channel closes (dk only) */
                    114: #define        M_IOCWAIT 0110          /* stop ioctl timeout, ack/nak follows later */
                    115: 
                    116: #define        setqsched()     mtpr(SIRR, 0x3);
                    117: 
                    118: /*
                    119:  * for passing files across streams
                    120:  */
                    121: struct kpassfd {
                    122:        union  {
                    123:                struct  file *fp;
                    124:                int     fd;
                    125:        } f;
                    126:        short   uid;
                    127:        short   gid;
                    128:        short   nice;
                    129:        char    logname[8];
                    130: };
                    131: 
                    132: /*
                    133:  * header for messages, see mesg.c
                    134:  */
                    135: 
                    136: struct mesg {
                    137:        char    type;
                    138:        u_char  magic;
                    139:        u_char  losize, hisize;
                    140: };
                    141: 
                    142: #define        MSGMAGIC        0345
                    143: #define        MSGHLEN 4       /* true length of struct mesg in bytes */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.