home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Portable Patmos / usr / include / sys / vsio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-08  |  5.7 KB  |  160 lines  |  [TEXT/R*ch]

  1. /*-
  2.  * Copyright (c) 1987 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    from: @(#)vsio.h    7.4 (Berkeley) 5/9/91
  34.  *    $Id: vsio.h,v 1.3 1993/05/20 16:23:55 cgd Exp $
  35.  */
  36.  
  37. #ifndef _SYS_VSIO_H_
  38. #define _SYS_VSIO_H_
  39.  
  40.  /****************************************************************************
  41.  *                                        *
  42.  *  Copyright (c) 1983, 1984 by                            *
  43.  *  DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts.            *
  44.  *  All rights reserved.                            *
  45.  *                                         *
  46.  *  This software is furnished on an as-is basis and may be used and copied *
  47.  *  only with inclusion of the above copyright notice. This software or any *
  48.  *  other copies thereof may be provided or otherwise made available to     *
  49.  *  others only for non-commercial purposes.  No title to or ownership of   *
  50.  *  the software is hereby transferred.                        *
  51.  *                                         *
  52.  *  The information in this software is  subject to change without notice   *
  53.  *  and  should  not  be  construed as  a commitment by DIGITAL EQUIPMENT   *
  54.  *  CORPORATION.                                *
  55.  *                                         *
  56.  *  DIGITAL assumes no responsibility for the use  or  reliability of its   *
  57.  *  software on equipment which is not supplied by DIGITAL.            *
  58.  *                                         *
  59.  *                                        *
  60.  ****************************************************************************/
  61. /* 
  62.  * vsio.h - VS100 I/O command definitions
  63.  * 
  64.  * Author:    Christopher A. Kent
  65.  *        Digital Equipment Corporation
  66.  *        Western Research Lab
  67.  * Date:    Tue Jun 21 1983
  68.  */
  69.  
  70. /* 
  71.  * Possible ioctl calls
  72.  */
  73.  
  74. #define    VSIOINIT    _IO('V', 0)        /* init the device */
  75. #define    VSIOSTART    _IOW('V', 1, int)    /* start microcode */
  76. #define    VSIOABORT    _IO('V', 2)        /* abort a command chain */
  77. #define    VSIOPWRUP    _IO('V', 3)        /* power-up reset */
  78. #define    VSIOGETVER    _IOR('V', 4, int)    /* get rom version */
  79. #define    VSIOSYNC    _IO('V', 6)        /* synch with device */
  80. #define    VSIOBBACTL    _IOW('V', 8, int)    /* control the BBA */
  81. #define    VSIOFIBCTL    _IOW('V', 9, int)    /* lamp on/off */
  82. #define    VSIOFIBRETRY    _IOW('V',10, int)    /* fiber retries */
  83. #define    VSIOGETSTATS    _IOR('V',11, vsStats)    /* get statistics */
  84. #define    VSIOGETIOA    _IOR('V',13, vsIoAddrAddr)/* get ioreg address */
  85. #define    VSIOUSERWAIT    _IO('V', 15)    /* wait for user I/O completion */
  86. #define VSIOWAITGO    _IOW('V', 16, caddr_t)    /* wait then go */
  87.  
  88.  
  89. #define    VSIO_OFF    0        /* option off */
  90. #define    VSIO_ON        1        /* option on */
  91.  
  92. #define    VS_FIB_FINITE    1        /* finite retries */
  93. #define    VS_FIB_INFINITE    2        /* infinite retries */
  94.  
  95. /* 
  96.  * Event queue entries
  97.  */
  98.  
  99. typedef struct    _vs_event{
  100.     u_short    vse_x;        /* x position */
  101.     u_short    vse_y;        /* y position */
  102.     u_short    vse_time;    /* 10 millisecond units (button only) */
  103.     char    vse_type;    /* button or motion? */
  104.     u_char    vse_key;    /* the key (button only) */
  105.     char    vse_direction;    /* which direction (button only) */
  106.     char    vse_device;    /* which device (button only) */
  107. }vsEvent;
  108.  
  109. #define    VSE_BUTTON    0        /* button moved */
  110. #define    VSE_MMOTION    1        /* mouse moved */
  111. #define    VSE_TMOTION    2        /* tablet moved */
  112.  
  113. #define    VSE_KBTUP    0        /* up */
  114. #define    VSE_KBTDOWN    1        /* down */
  115.  
  116. #define    VSE_MOUSE    1        /* mouse */
  117. #define    VSE_DKB        2        /* main keyboard */
  118. #define    VSE_TABLET    3        /* graphics tablet */
  119. #define    VSE_AUX        4        /* auxiliary */
  120. #define    VSE_CONSOLE    5        /* console */
  121.  
  122. typedef struct _vsStats{
  123.     int    errors;            /* count errors */
  124.     int    unsolIntr;        /* count unsolicited interrupts */
  125.     int    overruns;        /* event queue overruns */
  126.     int    flashes;        /* flashes on fiber link */
  127.     int    ignites;        /* times turned on */
  128.     int    douses;            /* times turned off */
  129.     int    linkErrors;        /* link errors */
  130. }vsStats;
  131.  
  132. typedef struct _vs_cursor{
  133.     short x;
  134.     short y;
  135. }vsCursor;
  136.  
  137. typedef struct _vs_box {
  138.     short bottom;
  139.     short right;
  140.     short left;
  141.     short top;
  142. }vsBox;
  143.  
  144. typedef struct _vsIoAddr {
  145.     short     *ioreg;
  146.     short     status;
  147.     caddr_t  obuff;
  148.     int     obufflen;
  149.     int     reloc;
  150.     vsEvent  *ibuff;
  151.     int     iqsize;        /* may assume power of 2 */
  152.     int     ihead;            /* atomic write */
  153.     int     itail;            /* atomic read */
  154.     vsCursor mouse;            /* atomic read/write */
  155.     vsBox     mbox;            /* atomic read/write */
  156. } vsIoAddr;
  157. typedef vsIoAddr *vsIoAddrAddr;
  158.  
  159. #endif /* !_SYS_VSIO_H_ */
  160.