Annotation of Net2/arch/hp300/dev/hilvar.h, revision 1.1.1.2

1.1       root        1: /*
                      2:  * Copyright (c) 1988 University of Utah.
                      3:  * Copyright (c) 1990 The Regents of the University of California.
                      4:  * All rights reserved.
                      5:  *
                      6:  * This code is derived from software contributed to Berkeley by
                      7:  * the Systems Programming Group of the University of Utah Computer
                      8:  * Science Department.
                      9:  *
                     10:  * Redistribution and use in source and binary forms, with or without
                     11:  * modification, are permitted provided that the following conditions
                     12:  * are met:
                     13:  * 1. Redistributions of source code must retain the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer.
                     15:  * 2. Redistributions in binary form must reproduce the above copyright
                     16:  *    notice, this list of conditions and the following disclaimer in the
                     17:  *    documentation and/or other materials provided with the distribution.
                     18:  * 3. All advertising materials mentioning features or use of this software
                     19:  *    must display the following acknowledgement:
                     20:  *     This product includes software developed by the University of
                     21:  *     California, Berkeley and its contributors.
                     22:  * 4. Neither the name of the University nor the names of its contributors
                     23:  *    may be used to endorse or promote products derived from this software
                     24:  *    without specific prior written permission.
                     25:  *
                     26:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     27:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     28:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     29:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     30:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     31:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     32:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     33:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     34:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     35:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     36:  * SUCH DAMAGE.
                     37:  *
                     38:  * from: Utah $Hdr: hilvar.h 1.1 90/07/09$
                     39:  *
1.1.1.2 ! root       40:  *     from: @(#)hilvar.h      7.2 (Berkeley) 11/4/90
        !            41:  *     hilvar.h,v 1.3 1993/07/04 02:26:54 cgd Exp
1.1       root       42:  */
                     43: 
                     44: #ifndef TRUE
                     45: #define TRUE   1
                     46: #define FALSE  0
                     47: #endif
                     48: 
                     49: #define NHILD          8               /* 7 actual + loop pseudo (dev 0) */
                     50: #define NHILQ          8               /* must be <= sizeof(int) */
                     51: 
                     52: #define HILBUFSIZE     40              /* size of interrupt poll buffer */
                     53: #define HILMAXCLIST    1024            /* max chars in clists for HPUX io */
                     54: 
                     55: #define HILLOOPDEV     0               /* loop device index */
                     56: 
                     57: /*
                     58:  * XXX: HPUX minor numbers are of the form "D0" where D is the device number
                     59:  * BSD uses "0D".  For compatibility we accept either.  Maybe we should just
                     60:  * use the HPUX numbering.
                     61:  */
                     62: #define HILUNIT(d)     (((((d)>>4)&7)==0)?((d)&7):(((d)>>4)&7))
                     63: 
                     64: #define        hildevmask(d)   (1 << (d))
                     65: #define        hilqmask(q)     (1 << (q))
                     66: 
                     67: struct hiliqueue {
                     68:        HILQ    *hq_eventqueue;         /* input queue shared with user */
                     69:        struct  proc *hq_procp;         /* process this queue belongs to */
                     70:        char    hq_devmask;             /* devices mapped to this queue */
                     71: };
                     72: 
                     73: struct hilloopdev {
                     74:        int     hd_flags;               /* device state */
                     75:        int     hd_qmask;               /* queues this device is mapped to */
1.1.1.2 ! root       76:        struct  ringb hd_queue;         /* event queue for HPUX-style input */
        !            77:        struct  selinfo hd_selr;        /* process read selecting */
1.1       root       78:        uid_t   hd_uid;                 /* uid of mapping process */
                     79: };
                     80: 
                     81: /* hd_flags */
                     82: #define        HIL_ALIVE       0x01    /* device is present */
                     83: #define HIL_PSEUDO     0x02    /* device is virtual */
                     84: #define HIL_READIN     0x04    /* device using read() input interface */
                     85: #define HIL_QUEUEIN    0x08    /* device using shared Q input interface */
1.1.1.2 ! root       86: /* was HIL_SELCOLL     0x10    /* select collision on device */
1.1       root       87: #define HIL_NOBLOCK    0x20    /* device is in non-blocking read mode */
                     88: #define HIL_ASLEEP     0x40    /* process awaiting input on device */
                     89: #define HIL_DERROR     0x80    /* loop has reconfigured, reality altered */
                     90: 
                     91: struct hilloop {
                     92:        struct  hil_dev *hl_addr;       /* base of hardware registers */
                     93:        u_char  hl_cmddone;             /* */
                     94:        u_char  hl_cmdending;           /* */
                     95:        u_char  hl_actdev;              /* current input device */
                     96:        u_char  hl_cmddev;              /* device to perform command on */
                     97:        u_char  hl_pollbuf[HILBUFSIZE]; /* interrupt time input buffer */
                     98:        u_char  hl_cmdbuf[HILBUFSIZE];  /* */
                     99:        u_char  *hl_pollbp;             /* pointer into hl_pollbuf */
                    100:        u_char  *hl_cmdbp;              /* pointer into hl_cmdbuf */
                    101:        struct  hiliqueue hl_queue[NHILQ];      /* input queues */
                    102:        struct  hilloopdev hl_device[NHILD];    /* device data */
                    103:        u_char  hl_maxdev;              /* number of devices on loop */
                    104:        u_char  hl_kbddev;              /* keyboard device on loop */
                    105:        u_char  hl_kbdlang;             /* keyboard language */
                    106:        u_char  hl_kbdflags;            /* keyboard state */
                    107: };
                    108: 
                    109: /* hl_kbdflags */
                    110: #define KBD_RAW                0x01            /* keyboard is raw */
                    111: #define KBD_AR1                0x02            /* keyboard auto-repeat rate 1 */
                    112: #define KBD_AR2                0x04            /* keyboard auto-repeat rate 2 */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.