home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / sys / vsio.h < prev    next >
Encoding:
Text File  |  1992-04-22  |  6.7 KB  |  188 lines

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