home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / iobuf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.2 KB  |  56 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_IOBUF_H
  11. #define _SYS_IOBUF_H
  12.  
  13. #ident    "@(#)/usr/include/sys/iobuf.h.sl 1.1 4.0 12/08/90 32844 AT&T-USL"
  14. /*
  15.  * Each IDFC controller has an iobuf, which contains private state data
  16.  * and 2 list heads: the b_forw/b_back list, which is doubly linked
  17.  * and has all the buffers currently associated with that major
  18.  * device; and the d_actf/d_actl list, which is private to the
  19.  * controller but in fact is always used for the head and tail
  20.  * of the I/O queue for the device.
  21.  * Various routines in bio.c look at b_forw/b_back
  22.  * (notice they are the same as in the buf structure)
  23.  * but the rest is private to each device controller.
  24.  */
  25. typedef struct iobuf
  26. {
  27.     int    b_flags;        /* see buf.h */
  28.     struct    buf *b_forw;        /* first buffer for this dev */
  29.     struct    buf *b_back;        /* last buffer for this dev */
  30.     struct    buf *b_actf;        /* head of I/O queue (b_forw)*/
  31.     struct     buf *b_actl;        /* tail of I/O queue (b_back)*/
  32.     o_dev_t    b_dev;            /* major+minor device name */
  33.     char    b_active;        /* busy flag */
  34.     char    b_errcnt;        /* error count (for recovery) */
  35.     int    jrqsleep;        /* process sleep counter on jrq full */
  36.     struct eblock    *io_erec;    /* error record */
  37.     int    io_nreg;        /* number of registers to log on errors */
  38.     paddr_t    io_addr;        /* local bus address */
  39.     physadr    io_mba;            /* mba address */
  40.     struct    iostat    *io_stp;    /* unit I/O statistics */
  41.     clock_t    io_start;
  42.     int    sgreq;            /* SYSGEN required flag */
  43.     int    qcnt;            /* outstanding job request counter */
  44.     int    io_s1;            /* space for drivers to leave things */
  45.     int    io_s2;            /* space for drivers to leave things */
  46.     dev_t    b_edev;            /* expanded device number */
  47. } iobuf_t;
  48.  
  49. #define tabinit(dv,stat) {0,0,0,0,0,makedev(dv,0),0,00,0,0,0,0,0,stat,0,0,0,0,0}
  50. #define NDEVREG    (sizeof(struct device)/sizeof(int))
  51.  
  52. #define    B_ONCE    01    /* flag for once only driver operations */
  53. #define    B_TIME    04    /* for timeout use */
  54.  
  55. #endif    /* _SYS_IOBUF_H */
  56.