home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / queue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  6.0 KB  |  180 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_QUEUE_H
  11. #define _SYS_QUEUE_H
  12.  
  13. #ident    "@(#)/usr/include/sys/queue.h.sl 1.1 4.0 12/08/90 58226 AT&T-USL"
  14. /* Express Queue Macros */
  15. #define R_EXP ((RQUEUE *)R_ADDR)->express
  16. #define C_EXP ((CQUEUE *)C_ADDR)->express
  17.  
  18. /* QUEUE POINTER MACROS */
  19.  
  20. /* all pointers */
  21. #define R_ALL(Q) ((RQUEUE *)R_ADDR)->queue[Q].p_queues.all
  22. #define C_ALL ((CQUEUE *)C_ADDR)->queue.p_queues.all
  23.  
  24. /* pointers as a sixteen bit quantity */
  25. #define R_SLOAD(Q) ((RQUEUE *)R_ADDR)->queue[Q].p_queues.bit16.load
  26. #define R_SULOAD(Q) ((RQUEUE *)R_ADDR)->queue[Q].p_queues.bit16.unload
  27.  
  28. #define C_SLOAD ((CQUEUE *)C_ADDR)->queue.p_queues.bit16.load
  29. #define C_SULOAD ((CQUEUE *)C_ADDR)->queue.p_queues.bit16.unload
  30.  
  31. /* pointers as an eight bit quantity  */
  32. #define R_BLOAD(Q) ((RQUEUE *)R_ADDR)->queue[Q].p_queues.bit8.unload
  33. #define R_BULOAD(Q) ((RQUEUE *)R_ADDR)->queue[Q].p_queues.bit8.unload
  34.  
  35. #define C_BLOAD ((CQUEUE *)C_ADDR)->queue.p_queues.bit8.load
  36. #define C_BULOAD ((CQUEUE *)C_ADDR)->queue.p_queues.bit8.unload
  37.  
  38. /* job entry at load pointer for 16 bit ptrs */
  39. #define Q_RSENTRY(Q) (RENTRY *)(R_SLOAD(Q)+(((RQUEUE *)R_ADDR)->queue[Q].entry))
  40.  
  41. /* job entry at load pointer for 8 bit ptrs */
  42. #define Q_RBENTRY(Q) (RENTRY *)(R_BLOAD(Q)+(((RQUEUE *)R_ADDR)->queue[Q].entry))
  43.  
  44. /* job completion at unload pointer for 16 bit ptrs */
  45. #define Q_CSENTRY (CENTRY *)(C_SULOAD+(((CQUEUE *)C_ADDR)->queue.entry))
  46.  
  47. /* job completion at unload pointer for 8 bit */
  48. #define Q_CBENTRY (CENTRY *)(C_BULOAD+(((CQUEUE *)C_ADDR)->queue.entry))
  49.  
  50. struct com_entry{
  51.        union{
  52.           struct {
  53.              unsigned bytcnt:16;     /* offset of last byte to transfer  */
  54.                                      /* 0 transfers byte 0               */
  55.  
  56. #ifdef x86
  57.          /* this for the Intel side since bit fields are assigned      */
  58.          /* opposite from WE32000                                    */
  59.              unsigned subdev:6;      /* Subdevice being addressed.       */
  60.              unsigned seqbit:1;      /* flag for block available         */
  61.              unsigned cmd_stat:1;    /* flag for command/status opcode   */
  62. #else
  63. #    ifdef b16
  64.          /* this for the Intel side since bit fields are assigned      */
  65.          /* opposite from WE32000                                    */
  66.              unsigned subdev:6;      /* Subdevice being addressed.       */
  67.              unsigned seqbit:1;      /* flag for block available         */
  68.              unsigned cmd_stat:1;    /* flag for command/status opcode   */
  69. #    else
  70.          /*                this for the m32 side                     */
  71.              unsigned cmd_stat:1;    /* flag for command/status opcode   */
  72.              unsigned seqbit:1;      /* flag for block available         */
  73.              unsigned subdev:6;      /* Subdevice being addressed.       */
  74.  
  75. #    endif
  76. #endif
  77.              unsigned opcode:8;      /* command or status opcode         */
  78.            }bits;
  79.            struct {
  80.              unsigned short bytcnt;
  81.              char subdev;
  82.              char opcode;
  83.            }bytes;
  84.         }codes;
  85.          long addr;     /* data or memory address of data       */
  86. };
  87.  
  88.  
  89. typedef struct {
  90.  
  91.      struct com_entry common;
  92.      CAPP appl;                      /* application defined area          */
  93.                                     /* CAPP for CENTRY         */
  94.  
  95. }CENTRY;                     /* CENTRY in completion queue        */
  96.  
  97.  
  98. typedef struct {
  99.  
  100.         /* entry for express requests */
  101.         CENTRY express;
  102.  
  103.         struct {
  104.                 /* Three ways of accessing load and unload ptrs */
  105.                 union {
  106.                         /* All pointers at once */
  107.                         long all;
  108.  
  109.                         /* 16 bit load ptr and 16 bit unload ptr */
  110.                         struct {
  111.                                 short load;
  112.                                 short unload;
  113.                         }bit16;
  114.  
  115.                         /* 8 bit load ptr and 8 bit unload ptr */
  116.                         struct {
  117.                                 char pad1;
  118.                                 char load;
  119.                                 char pad2;
  120.                                 char unload;
  121.                         }bit8;
  122.  
  123.                  }p_queues;
  124.  
  125.                  CENTRY entry[CQSIZE];
  126.  
  127.         }queue;            /* one for completion queue     */
  128.  
  129. } CQUEUE;
  130.  
  131. typedef struct {
  132.  
  133.          struct com_entry common;
  134.     RAPP appl;                  /* application defined area    */
  135. }RENTRY;            /* RENTRY in request queue        */
  136.  
  137. typedef struct {
  138.  
  139.         /* entry for express requests */
  140.         RENTRY express;
  141.  
  142.         struct {
  143.                 /* Three ways of accessing load and unload ptrs */
  144.                 union {
  145.                         /* All pointers at once */
  146.                         long all;
  147.  
  148.                         /* 16 bit load ptr and 16 bit unload ptr */
  149.                         struct {
  150.                                 short load;
  151.                                 short unload;
  152.                         }bit16;
  153.  
  154.                         /* 8 bit load ptr and 8 bit unload ptr */
  155.                         struct {
  156.                                 char pad1;
  157.                                 char load;
  158.                                 char pad2;
  159.                                 char unload;
  160.                         }bit8;
  161.  
  162.                  }p_queues;
  163.  
  164.                  RENTRY entry[RQSIZE];
  165.  
  166.         }queue[NUM_QUEUES];            /* #defined for request queue    */
  167.  
  168. } RQUEUE;
  169.  
  170. typedef struct {         /* sysgen data block */
  171.     long request;   /* address of request queue */
  172.     long complt;    /* address of cmplt queue   */
  173.     unsigned char req_size;  /* no entries in req q  */
  174.     unsigned char comp_size; /* no entries in cmplt q*/
  175.     unsigned char int_vect;  /* base intrpt vector   */
  176.     unsigned char no_rque;   /* number of req queues */
  177. }SG_DBLK;
  178.  
  179. #endif    /* _SYS_QUEUE_H */
  180.