65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1992 by David Dawes <dawes@XFree86.org>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1993 by Vrije Universiteit, The Netherlands
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1994-2003 by The XFree86 Project, Inc
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Permission to use, copy, modify, distribute, and sell this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsync * documentation for any purpose is hereby granted without fee, provided that
65fea56f17cd614bc8908264df980a62e1931468vboxsync * the above copyright notice appear in all copies and that both that
65fea56f17cd614bc8908264df980a62e1931468vboxsync * copyright notice and this permission notice appear in supporting
65fea56f17cd614bc8908264df980a62e1931468vboxsync * documentation, and that the names of the above listed copyright holders
65fea56f17cd614bc8908264df980a62e1931468vboxsync * not be used in advertising or publicity pertaining to distribution of
65fea56f17cd614bc8908264df980a62e1931468vboxsync * the software without specific, written prior permission. The above listed
65fea56f17cd614bc8908264df980a62e1931468vboxsync * copyright holders make no representations about the suitability of this
65fea56f17cd614bc8908264df980a62e1931468vboxsync * software for any purpose. It is provided "as is" without express or
65fea56f17cd614bc8908264df980a62e1931468vboxsync * implied warranty.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
65fea56f17cd614bc8908264df980a62e1931468vboxsync * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
65fea56f17cd614bc8908264df980a62e1931468vboxsync * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
65fea56f17cd614bc8908264df980a62e1931468vboxsync * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
65fea56f17cd614bc8908264df980a62e1931468vboxsync * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
65fea56f17cd614bc8908264df980a62e1931468vboxsync * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
65fea56f17cd614bc8908264df980a62e1931468vboxsync * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * The ARM32 code here carries the following copyright:
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 1997
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Digital Equipment Corporation. All rights reserved.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * This software is furnished under license and may be used and copied only in
65fea56f17cd614bc8908264df980a62e1931468vboxsync * accordance with the following terms and conditions. Subject to these
65fea56f17cd614bc8908264df980a62e1931468vboxsync * conditions, you may download, copy, install, use, modify and distribute
65fea56f17cd614bc8908264df980a62e1931468vboxsync * this software in source and/or binary form. No title or ownership is
65fea56f17cd614bc8908264df980a62e1931468vboxsync * transferred hereby.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * 1) Any source code used, modified or distributed must reproduce and retain
65fea56f17cd614bc8908264df980a62e1931468vboxsync * this copyright notice and list of conditions as they appear in the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * source file.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * 2) No right is granted to use any trade name, trademark, or logo of Digital
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Equipment Corporation. Neither the "Digital Equipment Corporation"
65fea56f17cd614bc8908264df980a62e1931468vboxsync * name nor any trademark or logo of Digital Equipment Corporation may be
65fea56f17cd614bc8908264df980a62e1931468vboxsync * used to endorse or promote products derived from this software without
65fea56f17cd614bc8908264df980a62e1931468vboxsync * the prior written permission of Digital Equipment Corporation.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * 3) This software is provided "AS-IS" and any express or implied warranties,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * including but not limited to, any implied warranties of merchantability,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * fitness for a particular purpose, or non-infringement are disclaimed.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * In no event shall DIGITAL be liable for any damages whatsoever, and in
65fea56f17cd614bc8908264df980a62e1931468vboxsync * particular, DIGITAL shall not be liable for special, indirect,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * consequential, or incidental damages or damages for lost profits, loss
65fea56f17cd614bc8908264df980a62e1931468vboxsync * of revenue or loss of use, whether such damages arise in contract,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * negligence, tort, under statute, in equity, at law or otherwise, even
65fea56f17cd614bc8908264df980a62e1931468vboxsync * if advised of the possibility of such damage.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * This is private, and should not be included by any drivers. Drivers
65fea56f17cd614bc8908264df980a62e1931468vboxsync * may include xf86_OSproc.h to get prototypes for public interfaces.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef _XF86_OSLIB_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define _XF86_OSLIB_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <X11/Xos.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <X11/Xfuncproto.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <stdio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <ctype.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <stddef.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* SYSV386 (SVR3, SVR4), including Solaris */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if (defined(SYSV) || defined(SVR4)) && \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (defined(sun) || defined(__i386__))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/ioctl.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <signal.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <termio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/stat.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/types.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <errno.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(_NEED_SYSI86)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !(defined (sun) && defined (SVR4))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/immu.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/region.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/proc.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/tss.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/sysi86.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(SVR4) && !defined(sun)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/seg.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* SVR4 && !sun */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(V86SC_IOPL) /* Solaris 7 or later? */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/v86.h> /* Nope */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/psw.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* _NEED_SYSI86 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(HAS_SVR3_MMAPDRV)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/sysmacros.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(_NEED_SYSI86)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/immu.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/region.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/mmap.h> /* MMAP driver header */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(sun) || defined(HAVE_SYS_VT_H)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define HAS_USL_VTS
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(sun)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/emap.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(HAS_USL_VTS)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(sun)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/at_ansi.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/kd.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/vt.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(sun)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/fbio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/kbd.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/kbio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
65fea56f17cd614bc8908264df980a62e1931468vboxsync definitions in parser/xf86tokens.h */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef STRING
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef LEFTALT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef RIGHTALT
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LED_CAP LED_CAPS_LOCK
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LED_NUM LED_NUM_LOCK
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LED_SCR LED_SCROLL_LOCK
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LED_COMP LED_COMPOSE
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* sun */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(VT_ACKACQ)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define VT_ACKACQ 2
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* !VT_ACKACQ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(SVR4)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/mman.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !(defined(sun) && defined (SVR4))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DEV_MEM "/dev/pmem"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CLEARDTR_SUPPORT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define POSIX_TTY
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* SVR4 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* (SYSV || SVR4) */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Linux or Glibc-based system */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/ioctl.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <signal.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <stdlib.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/types.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <assert.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __linux__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <termio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else /* __GLIBC__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <termios.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __sparc__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/param.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <errno.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/stat.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/mman.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __linux__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define HAS_USL_VTS
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/kd.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/vt.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LDGMAP GIO_SCRNMAP
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LDSMAP PIO_SCRNMAP
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LDNMAP LDSMAP
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CLEARDTR_SUPPORT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define POSIX_TTY
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __linux__ || __GLIBC__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* 386BSD and derivatives, BSD/386 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef __386BSD__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef CSRG_BASED
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/ioctl.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <signal.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <termios.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define termio termios
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define POSIX_TTY
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <errno.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/types.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/mman.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/stat.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* CSRG_BASED */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Kernel of *BSD */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
65fea56f17cd614bc8908264df980a62e1931468vboxsync defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/param.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define __FreeBSD_kernel_version __FreeBSD_version
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(LINKKIT)
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Don't need this stuff for the Link Kit */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef SYSCONS_SUPPORT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define COMPAT_SYSCONS
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/consio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/kbio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <machine/console.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* FreeBSD 4.1 RELEASE or lator */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/console.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* SYSCONS_SUPPORT */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(SYSCONS_SUPPORT)
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* no syscons, so include pcvt specific header file */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <machine/pcvt_ioctl.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/pcvt_ioctl.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __FreeBSD_kernel__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else /* pcvt and syscons: hard-code the ID magic */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define VGAPCVTID _IOWR('V',113, struct pcvtid)
65fea56f17cd614bc8908264df980a62e1931468vboxsyncstruct pcvtid {
65fea56f17cd614bc8908264df980a62e1931468vboxsync char name[16];
65fea56f17cd614bc8908264df980a62e1931468vboxsync int rmajor, rminor;
65fea56f17cd614bc8908264df980a62e1931468vboxsync};
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* PCVT_SUPPORT */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef WSCONS_SUPPORT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <dev/wscons/wsconsio.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <dev/wscons/wsdisplay_usl_io.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* WSCONS_SUPPORT */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/mouse.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Include these definitions in case ioctl_pc.h didn't get included */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_X_MODE_ON
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_X_MODE_ON _IO('t',121)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_X_MODE_OFF
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_X_MODE_OFF _IO('t',122)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_X_BELL
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_X_BELL _IOW('t',123,int[2])
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_X_TV_ON
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_X_TV_ON _IOW('t',155,int)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define XMODE_RGB 0
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define XMODE_NTSC 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define XMODE_PAL 2
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define XMODE_SECAM 3
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_X_TV_OFF
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_X_TV_OFF _IO('t',156)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_GET_LINEAR_INFO
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_GET_IO_INFO
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef CONSOLE_GET_MEM_INFO
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* !LINKKIT */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <machine/sysarch.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CLEARDTR_SUPPORT
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* IRIX */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Generic */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/**************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <sys/wait.h> /* May need to adjust this for other OSs */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* For PATH_MAX */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "misc.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * and it's safe, so just do it.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(O_NDELAY) && defined(O_NONBLOCK)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define O_NDELAY O_NONBLOCK
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* !O_NDELAY && O_NONBLOCK */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(MAXHOSTNAMELEN)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXHOSTNAMELEN 32
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* !MAXHOSTNAMELEN */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(_POSIX_SOURCE)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <limits.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define _POSIX_SOURCE
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <limits.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef _POSIX_SOURCE
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* _POSIX_SOURCE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef DEV_MEM
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DEV_MEM "/dev/mem"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef MAP_FAILED
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAP_FAILED ((void *)-1)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define XF86_OS_PRIVS
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "xf86_OSproc.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef NO_COMPILER_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "compiler.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* _XF86_OSLIB_H */