home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / iobuf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  1.8 KB  |  50 lines

  1. /*
  2.  *    @(#) iobuf.h 2.1 88/05/18 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /*
  12.  * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
  13.  * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
  14.  * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
  15.  * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
  16.  */
  17.  
  18. /*
  19.  * Each block device has a iobuf, which contains private state stuff
  20.  * and 2 list heads: the b_forw/b_back list, which is doubly linked
  21.  * and has all the buffers currently associated with that major
  22.  * device; and the d_actf/d_actl list, which is private to the
  23.  * device but in fact is always used for the head and tail
  24.  * of the I/O queue for the device.
  25.  * Various routines in bio.c look at b_forw/b_back
  26.  * (notice they are the same as in the buf structure)
  27.  * but the rest is private to each device driver.
  28.  */
  29. struct iobuf
  30. {
  31.     int    b_flags;        /* see buf.h */
  32.     struct    buf *b_forw;        /* first buffer for this dev */
  33.     struct    buf *b_back;        /* last buffer for this dev */
  34.     struct    buf *b_actf;        /* head of I/O queue */
  35.     struct     buf *b_actl;        /* tail of I/O queue */
  36.     dev_t    b_dev;            /* major+minor device name */
  37.     char    b_active;        /* busy flag */
  38.     char    b_errcnt;        /* error count (for recovery) */
  39.     physadr    io_addr;        /* csr address */
  40.     int    io_s1;            /* space for drivers to leave things */
  41.     int    io_s2;            /* space for drivers to leave things */
  42. };
  43.  
  44. #define tabinit(dv)    {0,0,0,0,0,makedev(dv,0),0,0,0,0,0}
  45. #define NDEVREG    (sizeof(struct device)/sizeof(int))
  46.  
  47. #define    B_ONCE    01    /* flag for once only driver operations */
  48. #define    B_TAPE    02    /* this is a magtape (no bdwrite) */
  49. #define    B_TIME    04    /* for timeout use */
  50.