home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / conf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.8 KB  |  138 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_CONF_H
  11. #define _SYS_CONF_H
  12.  
  13. #ident    "@(#)/usr/include/sys/conf.h.sl 1.1 4.0 12/08/90 40727 AT&T-USL"
  14.  
  15. /*
  16.  * Declaration of block device switch. Each entry (row) is
  17.  * the only link between the main unix code and the driver.
  18.  * The initialization of the device switches is in the file conf.c.
  19.  */
  20. struct bdevsw {
  21.     int    (*d_open)();
  22.     int    (*d_close)();
  23.     int    (*d_strategy)();
  24.     int    (*d_print)();
  25.     int    (*d_size)();
  26.     int    (*d_xpoll)();
  27.     int    (*d_xhalt)();
  28.     char    *d_name;
  29.     struct iobuf    *d_tab;
  30.     int    *d_flag;
  31. };
  32.  
  33. extern struct bdevsw bdevsw[];
  34. extern struct bdevsw shadowbsw[];
  35.  
  36. /*
  37.  * Character device switch.
  38.  */
  39. struct cdevsw {
  40.     int    (*d_open)();
  41.     int    (*d_close)();
  42.     int    (*d_read)();
  43.     int    (*d_write)();
  44.     int    (*d_ioctl)();
  45.     int    (*d_mmap)();
  46.     int    (*d_segmap)();
  47.     int    (*d_poll)();
  48.     int    (*d_xpoll)();
  49.     int    (*d_xhalt)();
  50.     struct tty *d_ttys;
  51.     struct streamtab *d_str;
  52.     char    *d_name;
  53.     int    *d_flag;
  54. };
  55.  
  56. extern struct cdevsw cdevsw[];
  57. extern struct cdevsw shadowcsw[];
  58.  
  59.  
  60. /*
  61.  * And the console co routine.  This is declared as
  62.  * a configuration parameter so that it can be changed
  63.  * to match /dev/console.
  64.  */
  65. struct  conssw {
  66.     int (*co)();
  67.     int co_dev;
  68.     int (*ci)();
  69. };
  70.  
  71. extern struct conssw conssw;
  72.  
  73.  
  74.  
  75. /*
  76.  * Device flags.
  77.  *
  78.  * Bit 0 to bit 15 are reserved for kernel.
  79.  * Bit 16 to bit 31 are reserved for different machines.
  80.  */
  81. #define D_NEW        0x00    /* new-style driver */
  82. #define    D_OLD        0x01    /* old-style driver */
  83. #define D_DMA        0x02    /* driver does DMA  */
  84. /*
  85.  * Added for UFS.
  86.  */
  87. #define D_SEEKNEG       0x04    /* Negative seek offsets are OK */
  88. #define D_TAPE          0x08    /* Magtape device (no bdwrite when cooked) */
  89. /*
  90.  * Added for pre-4.0 drivers backward compatibility.
  91.  */
  92. #define D_NOBRKUP    0x10    /* No breakup needed for new drivers */
  93.  
  94. #define ROOTFS_NAMESZ    7    /* Maximum length of root fstype name */
  95.  
  96. #define    FMNAMESZ    8
  97.  
  98. struct fmodsw {
  99.     char    f_name[FMNAMESZ+1];
  100.     struct streamtab *f_str;
  101.     int    *f_flag;        /* same as device flag */
  102. };
  103. extern struct fmodsw fmodsw[];
  104.  
  105. extern int    bdevcnt;
  106. extern int    cdevcnt;
  107. extern int    fmodcnt;
  108.  
  109. /*
  110.  * Line discipline switch.
  111.  */
  112. struct linesw {
  113.     int    (*l_open)();
  114.     int    (*l_close)();
  115.     int    (*l_read)();
  116.     int    (*l_write)();
  117.     int    (*l_ioctl)();
  118.     int    (*l_input)();
  119.     int    (*l_output)();
  120.     int    (*l_mdmint)();
  121. };
  122. extern struct linesw linesw[];
  123.  
  124. extern int    linecnt;
  125. /*
  126.  * Terminal switch
  127.  */
  128. struct termsw {
  129.     int    (*t_input)();
  130.     int    (*t_output)();
  131.     int    (*t_ioctl)();
  132. };
  133. extern struct termsw termsw[];
  134.  
  135. extern int    termcnt;
  136.  
  137. #endif    /* _SYS_CONF_H */
  138.