make X11R5 compile easier

This commit is contained in:
deraadt 1994-07-21 22:06:13 +00:00
parent 341769b598
commit 822b1d1d65
4 changed files with 262 additions and 2 deletions

View File

@ -0,0 +1,81 @@
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Lawrence Berkeley Laboratory.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)kbd.h 8.1 (Berkeley) 6/11/93
*
* from: Header: kbd.h,v 1.5 92/11/26 01:15:33 torek Exp (LBL)
* $Id: kbd.h,v 1.1 1994/07/21 22:06:13 deraadt Exp $
*/
/*
* Keyboard `registers'. (This should be called kbd_reg.h but we need to
* be compatible.)
*/
/*
* Control codes sent from type 2, 3, and 4 keyboards.
*
* Note that KBD_RESET is followed by a keyboard ID, while KBD_IDLE is not.
* KBD_IDLE does not take the place of any `up' transitions (it merely occurs
* after them).
*/
#define KBD_RESET 0xff /* keyboard `reset' response */
#define KBD_IDLE 0x7f /* keyboard `all keys are up' code */
/* Keyboard IDs */
#define KB_SUN2 2 /* type 2 keyboard */
#define KB_SUN3 3 /* type 3 keyboard */
#define KB_SUN4 4 /* type 4 keyboard */
/* Key codes are in 0x00..0x7e; KBD_UP is set if the key goes up */
#define KBD_KEYMASK 0x7f /* keyboard key mask */
#define KBD_UP 0x80 /* keyboard `up' transition */
/* Keyboard codes needed to recognize the L1-A sequence */
#define KBD_L1 1 /* keyboard code for `L1' key */
#define KBD_A 77 /* keyboard code for `A' key */
/* Control codes sent to the various keyboards */
#define KBD_CMD_RESET 1 /* reset keyboard */
#define KBD_CMD_BELL 2 /* turn bell on */
#define KBD_CMD_NOBELL 3 /* turn bell off */
#define KBD_CMD_CLICK 10 /* turn keyclick on */
#define KBD_CMD_NOCLICK 11 /* turn keyclick off */

View File

@ -0,0 +1,91 @@
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Lawrence Berkeley Laboratory.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)kbio.h 8.1 (Berkeley) 6/11/93
*
* from: Header: kbio.h,v 1.4 92/11/26 01:16:32 torek Exp (LBL)
* $Id: kbio.h,v 1.1 1994/07/21 22:06:17 deraadt Exp $
*/
/*
* The following is a minimal emulation of Sun's `kio' structures
* and related operations necessary to make X11 happy (i.e., make it
* compile, and make old X11 binaries run).
*/
/*
* The kiockey structure apparently gets and/or sets keyboard mappings.
* It seems to be kind of useless, but X11 uses it (according to the
* comments) to figure out when a Sun 386i has a type-4 keyboard but
* claims to have a type-3 keyboard. We need just enough to cause the
* appropriate ioctl to return the appropriate magic value.
*
* KIOCGETKEY fills in kio_entry from kio_station. Not sure what tablemask
* is for; X sets it before the call, so it is not an output, but we do not
* care anyway. KIOCSDIRECT is supposed to tell the kernel whether to send
* keys to the console or to X; we just send them to X whenever the keyboard
* is open at all. (XXX may need to change this later)
*
* Keyboard commands and types are defined in kbd.h as they are actually
* real hardware commands and type numbers.
*/
struct kiockey {
int kio_tablemask; /* whatever */
u_char kio_station; /* key number */
u_char kio_entry; /* HOLE if not present */
char kio_text[10]; /* the silly escape sequences (unsupported) */
};
#define HOLE 0x302 /* value for kio_entry to say `really type 3' */
#define KIOCTRANS _IOW('k', 0, int) /* set translation mode */
/* (we only accept TR_UNTRANS_EVENT) */
#define KIOCGETKEY _IOWR('k', 2, struct kiockey) /* fill in kio_entry */
#define KIOCGTRANS _IOR('k', 5, int) /* get translation mode */
#define KIOCCMD _IOW('k', 8, int) /* X uses this to ring bell */
#define KIOCTYPE _IOR('k', 9, int) /* get keyboard type */
#define KIOCSDIRECT _IOW('k', 10, int) /* keys to console? */
#define KIOCLAYOUT _IOR('k', 20, int) /* get keyboard layout */
#define TR_NONE 0 /* X compat, unsupported */
#define TR_ASCII 1 /* X compat, unsupported */
#define TR_EVENT 2 /* X compat, unsupported */
#define TR_UNTRANS_EVENT 3

View File

@ -0,0 +1,88 @@
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Lawrence Berkeley Laboratory.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)vuid_event.h 8.1 (Berkeley) 6/11/93
*
* from: Header: vuid_event.h,v 1.4 92/11/26 01:20:27 torek Exp (LBL)
* $Id: vuid_event.h,v 1.1 1994/07/21 22:06:20 deraadt Exp $
*/
/*
* The following is a minimal emulation of Sun's `Firm_event' structures
* and related operations necessary to make X11 happy (i.e., make it
* compile, and make old X11 binaries run).
*/
typedef struct firm_event {
u_short id; /* key or MS_* or LOC_[XY]_DELTA */
u_short pad; /* unused, at least by X11 */
int value; /* VKEY_{UP,DOWN} or locator delta */
struct timeval time;
} Firm_event;
/*
* Special `id' fields. These weird numbers simply match the old binaries.
* Others are in 0..0x7f and are keyboard key numbers (keyboard dependent!).
*/
#define MS_LEFT 0x7f20 /* left mouse button */
#define MS_MIDDLE 0x7f21 /* middle mouse button */
#define MS_RIGHT 0x7f22 /* right mouse button */
#define LOC_X_DELTA 0x7f80 /* mouse delta-X */
#define LOC_Y_DELTA 0x7f81 /* mouse delta-Y */
#define LOC_X_ABSOLUTE 0x7f82 /* X compat, unsupported */
#define LOC_Y_ABSOLUTE 0x7f83 /* X compat, unsupported */
/*
* Special `value' fields. These apply to keys and mouse buttons. The
* value of a mouse delta is the delta. Note that positive deltas are
* left and up (not left and down as you might expect).
*/
#define VKEY_UP 0 /* key or button went up */
#define VKEY_DOWN 1 /* key or button went down */
/*
* The following ioctls are clearly intended to take things in and out
* of `firm event' mode. Since we always run in this mode (as far as
* /dev/kbd and /dev/mouse are concerned, anyway), we always claim to
* be in this mode and reject anything else.
*/
#define VUIDSFORMAT _IOW('v', 1, int)
#define VUIDGFORMAT _IOR('v', 2, int)
#define VUID_FIRM_EVENT 1 /* the only format we support */

View File

@ -42,7 +42,7 @@
* @(#)rcons_kern.c 8.1 (Berkeley) 6/11/93
*
* from: Header: rcons_kern.c,v 1.28 93/04/20 11:15:38 torek Exp
* $Id: rcons_kern.c,v 1.4 1994/05/05 09:55:46 deraadt Exp $
* $Id: rcons_kern.c,v 1.5 1994/07/21 22:06:27 deraadt Exp $
*/
#include <sys/param.h>
@ -56,7 +56,7 @@
#include <machine/fbvar.h>
#include <machine/autoconf.h>
#include <sparc/dev/kbd.h>
#include <machine/kbd.h>
#include <sparc/rcons/raster.h>