home *** CD-ROM | disk | FTP | other *** search
/ More Insanity: Totally Insane 2 / totally_insane_ii.iso / src / PCIdriver / coco_user.h next >
Encoding:
C/C++ Source or Header  |  1997-05-29  |  6.4 KB  |  160 lines

  1. /* ================================
  2.  *    Misc.
  3.  * ================================ */
  4.  
  5. #define DMA_REGS    4
  6. #define INT_RAM_SIZE    256    /* in 32-bit values  */
  7. #define EXT_RAM_SIZE    65536  /* in 32-bits = 262K bytes */
  8.  
  9. /* ==========================
  10.  *     Coco Commands
  11.  * ========================== */
  12. #define COCO_NOOP      0x00000000L      /*  no op                           */
  13. #define COCO_FILLRAMIL 0x01000000L      /* fill LS bits of internal LUT     */
  14. #define COCO_FILLRAMIH 0x02000000L      /* fill MS bits of internal LUT     */
  15. #define COCO_FILLRAML  0x03000000L      /* fill external LUT                */
  16. #define COCO_FILLRAMO  0x04000000L      /* fill internal output LUT         */
  17. #define COCO_SETMODE   0x05000000L      /* set mode register                */
  18. #define COCO_SETADDR   0x06000000L      /* set address resgister            */
  19. #define COCO_READRAMIL 0x07000000L      /* read LS bits of internal inp LUT */
  20. #define COCO_READRAMIH 0x08000000L      /* read MS bits of internal inp LUT */
  21. #define COCO_READRAML  0x09000000L      /* read external LUT                */
  22. #define COCO_READRAMO  0x0A000000L      /* read internal output LUT         */
  23. #define COCO_READMODE  0x0B000000L      /* read mode register               */
  24. #define COCO_READADDR  0x0C000000L      /* read address register            */
  25. #define COCO_TRANSP    0x0D000000L      /* pass data transparent            */
  26. #define COCO_CONVERT   0x0F000000L      /* convert data                     */
  27.  
  28.  
  29. /* =================================
  30.  *    IOCTL Commands
  31.  * =================================
  32.  */
  33.  
  34. #define COCO_COMMAND        0x403 /*  issue a Chameleon command           */
  35. #define COCO_RAW_READ_FIFO      0x404 /*  slave read a word from Amcc Fifo    */
  36. #define COCO_RAW_WRITE_FIFO     0x405 /*  slave write a word to Amcc Fifo     */
  37. #define COCO_RAW_READB_FIFO     0x406 /*  slave read a buf from Amcc Fifo     */
  38. #define COCO_RAW_WRITEB_FIFO    0x407 /*  slave write a buf to Amcc Fifo      */
  39. #define COCO_FIFO_TEST        0x408 /*  Do internal Amcc Fifo access test   */
  40. #define COCO_SET_MODE           0x409 /*  set Chameleon mode                  */
  41. #define COCO_READ_MODE          0x410 /*  Read current Chameleon Mode         */
  42. #define COCO_RAW_READ_DMA    0x411 /*  read  words from Normal DMA regs    */
  43. #define COCO_RAW_WRITE_DMA    0x412 /*  write words to Normal DMA regs      */
  44. #define COCO_READ_ADDR        0x413 /*  read Address register               */
  45. #define COCO_SET_ADDR        0x414 /*  set Address register                */
  46. #define COCO_DMAREGS_TEST       0x415 /*  Test Access to Normal DMA regs      */
  47. #define COCO_INTRAM_TEST      0x416 /*  Test Internal Ram LUT accesses      */
  48. #define COCO_EXTRAM_TEST      0x417 /*  Test External Ram LUT access        */
  49.  
  50. #define COCO_READ_RAMIL     0x418 /*  slave Read Internal RamIL Lut       */
  51. #define COCO_READ_RAMIH        0x419 /*  slave Read Internal RamIH Lut       */
  52. #define COCO_READ_RAMO        0x420 /*  slave Read Internal RamO  Lut       */
  53. #define COCO_READ_RAML        0x421 /*  slave Read External RamL  Lut       */
  54. #define COCO_FILL_RAMIL     0x422 /*  slave Write Internal RamIL Lut      */
  55. #define COCO_FILL_RAMIH        0x423 /*  slave Write Internal RamIH Lut      */
  56. #define COCO_FILL_RAMO        0x424 /*  slave Write Internal RamO  Lut      */
  57. #define COCO_FILL_RAML        0x425 /*  slave Write External RamL  Lut      */
  58.  
  59. #define COCO_CONVERT_PIXLE      0x426 /*  Convert single pixle (word)         */
  60. #define COCO_CONVERT_TEST       0x427 /*  test single pixle conversion        */
  61.  
  62. #define COCO_SET_SINGLE_DMA     0x428 /*  Set DMA mode to SINGLE              */
  63. #define COCO_SET_PROG_DMA       0x429 /*  Set DMA mode to CHAIN (Prog)        */
  64.  
  65. #define COCO_BLOCK_FILL_RAMIL   0x430 /*  DMA data to Internal RamIL Lut      */
  66. #define COCO_BLOCK_FILL_RAMIH   0x431 /*  DMA data to Internal RamIH Lut      */
  67. #define COCO_BLOCK_FILL_RAML    0x432 /*  DMA data to External RamL  Lut      */
  68. #define COCO_BLOCK_FILL_RAMO    0x433 /*  DMA data to Internal RamO  Lut      */
  69. #define COCO_SETCMD_TRANSP      0x434 /*  set DMA command to Transparent      */
  70. #define COCO_SETCMD_CONVERT     0x435 /*  set DMA command to Convert          */
  71. #define COCO_RESET        0x436 /*  Reset Chameleon board               */
  72. #define COCO_RW_BUF             0x437 /*  start a Sim. read/write DMA         */
  73. #define COCO_ISPCI              0x438 /*  test if PCI Chameleon board         */
  74. #define COCO_MAP_SIZE           0x439 /*  return bytes available for Map      */
  75. #define COCO_GET_TIME           0x440 /*  return timing measurements          */
  76. #define COCO_MKHWGR             0x441 /*  cmd issued by ioconig for hwgraph   */
  77.  
  78. /* 
  79.  *    struct used by 
  80.  *        COCO_READ_RAMIL
  81.  *        COCO_READ_RAMIH
  82.  *        COCO_READ_RAMO
  83.  *        COCO_READ_RAML
  84.  *        COCO_FILL_RAMIL
  85.  *        COCO_FILL_RAMIH
  86.  *        COCO_FILL_RAMO
  87.  *        COCO_FILL_RAML
  88.  *      COCO_RAW_READB_FIFO
  89.  *      COCO_RAW_WRITEB_FIFO
  90.  *      COCO_BLOCK_FILL_RAMIL
  91.  *      COCO_BLOCK_FILL_RAMIH
  92.  *      COCO_BLOCK_FILL_RAML 
  93.  *      COCO_BLOCK_FILL_RAMO 
  94.  *
  95.  */ 
  96. typedef struct {
  97.     int             buf_size;  /*  buf size (in 32-bit words)  */
  98.     unsigned int    *buf;       /*  buffer address              */
  99. } coco_buf_t; 
  100.  
  101.  
  102. /*
  103.  *   struct used by COCO_SET_MODE
  104.  */
  105. typedef struct {
  106.     int    mode;
  107.     int    swap;
  108.     int    slice;
  109.     int    flag;
  110. } coco_mode_t;
  111.  
  112.  
  113. /*
  114.  *  struct used for COCO_COMMAND
  115.  */
  116. typedef struct {
  117.     unsigned int  cmd;      /*  command to give to Chameleon  */
  118.     unsigned int  datav;    /*  data associated with command  */
  119. } coco_cmd_t;
  120.  
  121.  
  122. /*
  123.  *  struct used for COCO_CONVERT_TEST
  124.  */
  125. typedef struct {
  126.     unsigned int  in;    /*  value to convert  */
  127.     unsigned int  out;    /*  expected result   */
  128.     int          result;   /*  conversion result (0 = success) */ 
  129. } coco_convert_t;
  130.  
  131.  
  132. /*
  133.  *  struct used for COCO_RW_BUF
  134.  */
  135. typedef struct {
  136.     int    buf_size;      /*  buffer size in int32   */
  137.     int    adjust_chain;  /*  1 = adjust read/write chain entries */
  138.     unsigned int *r_buf;   /*  read buffer            */
  139.     unsigned int *w_buf;   /*  write buffer           */
  140. } coco_rw_t;
  141.  
  142.  
  143. /*
  144.  *   struct used for COCO_GET_TIME
  145.  *   After each DMA, the start and end time can be obtained
  146.  */
  147. typedef struct {
  148.     int    coco_sec;    /*  seconds      */
  149.     int    coco_msec;   /*  miliseconds  */
  150.     int    coco_usec;   /*  microseconds */
  151.     int    coco_nsec;   /*  nanoseconds  */
  152. } coco_timeval_t;
  153.  
  154. typedef struct {
  155.     coco_timeval_t  start_time;   /*  time call received  */
  156.     coco_timeval_t  end_time;     /*  time driver returned to user */
  157.     coco_timeval_t  diff_time;    /*  the difference  */
  158. } coco_time_t;
  159.  
  160.