45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1992 by David Dawes <dawes@XFree86.org>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1993 by Vrije Universiteit, The Netherlands
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1994-2003 by The XFree86 Project, Inc
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission to use, copy, modify, distribute, and sell this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation for any purpose is hereby granted without fee, provided that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the above copyright notice appear in all copies and that both that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copyright notice and this permission notice appear in supporting
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation, and that the names of the above listed copyright holders
45e9809aff7304721fddb95654901b32195c9c7avboxsync * not be used in advertising or publicity pertaining to distribution of
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the software without specific, written prior permission. The above listed
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copyright holders make no representations about the suitability of this
45e9809aff7304721fddb95654901b32195c9c7avboxsync * software for any purpose. It is provided "as is" without express or
45e9809aff7304721fddb95654901b32195c9c7avboxsync * implied warranty.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
45e9809aff7304721fddb95654901b32195c9c7avboxsync * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
45e9809aff7304721fddb95654901b32195c9c7avboxsync * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
45e9809aff7304721fddb95654901b32195c9c7avboxsync * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
45e9809aff7304721fddb95654901b32195c9c7avboxsync * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
45e9809aff7304721fddb95654901b32195c9c7avboxsync * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The ARM32 code here carries the following copyright:
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 1997
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Digital Equipment Corporation. All rights reserved.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This software is furnished under license and may be used and copied only in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * accordance with the following terms and conditions. Subject to these
45e9809aff7304721fddb95654901b32195c9c7avboxsync * conditions, you may download, copy, install, use, modify and distribute
45e9809aff7304721fddb95654901b32195c9c7avboxsync * this software in source and/or binary form. No title or ownership is
45e9809aff7304721fddb95654901b32195c9c7avboxsync * transferred hereby.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * 1) Any source code used, modified or distributed must reproduce and retain
45e9809aff7304721fddb95654901b32195c9c7avboxsync * this copyright notice and list of conditions as they appear in the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * source file.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * 2) No right is granted to use any trade name, trademark, or logo of Digital
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Equipment Corporation. Neither the "Digital Equipment Corporation"
45e9809aff7304721fddb95654901b32195c9c7avboxsync * name nor any trademark or logo of Digital Equipment Corporation may be
45e9809aff7304721fddb95654901b32195c9c7avboxsync * used to endorse or promote products derived from this software without
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the prior written permission of Digital Equipment Corporation.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * 3) This software is provided "AS-IS" and any express or implied warranties,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * including but not limited to, any implied warranties of merchantability,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * fitness for a particular purpose, or non-infringement are disclaimed.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * In no event shall DIGITAL be liable for any damages whatsoever, and in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * particular, DIGITAL shall not be liable for special, indirect,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * consequential, or incidental damages or damages for lost profits, loss
45e9809aff7304721fddb95654901b32195c9c7avboxsync * of revenue or loss of use, whether such damages arise in contract,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * negligence, tort, under statute, in equity, at law or otherwise, even
45e9809aff7304721fddb95654901b32195c9c7avboxsync * if advised of the possibility of such damage.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This is private, and should not be included by any drivers. Drivers
45e9809aff7304721fddb95654901b32195c9c7avboxsync * may include xf86_OSproc.h to get prototypes for public interfaces.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Define some things from the "ANSI" C wrappers that are needed in the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the core server.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void xf86usleep(unsigned long);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int xf86getpagesize(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int xf86GetErrno(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* SYSV386 (SVR3, SVR4), including Solaris */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define TIOCMSET (TIOC|26) /* set all modem bits */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define TIOCMGET (TIOC|29) /* get all modem bits */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* SVR4 && !sun */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(i386) || defined(__x86) /* on x86 or x64? */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* V86SC_IOPL */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* sun && i386 && SVR4 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(sun) && (defined (i386) || defined(__x86)) && defined (SVR4)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* _NEED_SYSI86 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if !defined(_NEED_SYSI86)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if !defined(sun) || (!defined(sparc) && !defined(__SOL8__))
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if !defined(sun)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(SCO325)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
45e9809aff7304721fddb95654901b32195c9c7avboxsync definitions in parser/xf86tokens.h */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* sun */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if !defined(VT_ACKACQ)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* !VT_ACKACQ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__SCO__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* __SCO__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* SVR4 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(sun) && defined (i386) && defined (SVR4) && !defined(__SOL8__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* ATT && !i386 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if !defined(ISC) || defined(ISC202) || defined(ISC22)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* (SYSV || SVR4) && !DGUX */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* DG/ux R4.20MU03 Intel AViion Machines */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <termios.h> /* Use termios for BSD Flavor ttys */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <sys/kd.h> /* definitios for KDENABIO KDDISABIO needed for IOPL s */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* General keyboard types */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define KB_101 1 /* Because ioctl(dgkeybdFd,KBD_GET_LANGUAGE,&type) gives 1=US keyboard */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define VT_SYSREQ_DEFAULT FALSE /* Make sure that we dont define any VTs since DG/ux has none */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* DGUX && SVR4 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Linux or Glibc-based system */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync# else /* __GLIBC__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* __linux__ || __GLIBC__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* LynxOS AT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if defined(Lynx)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* smem_create et.al. to access physical memory */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* keyboard types */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* atc drivers ignores argument to VT_RELDISP ioctl */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* LynxOS 2.5.1 has these */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* Lynx */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* 386BSD and derivatives, BSD/386 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__bsdi__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* __bsdi__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* CSRG_BASED */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Kernel of *BSD */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
45e9809aff7304721fddb95654901b32195c9c7avboxsync defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if !defined(LINKKIT)
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Don't need this stuff for the Link Kit */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__bsdi__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# else /* __bsdi__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* FreeBSD 4.1 RELEASE or lator */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* SYSCONS_SUPPORT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* no syscons, so include pcvt specific header file */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* WSCONS_SUPPORT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* __NetBSD__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* __FreeBSD_kernel__ || __OpenBSD__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# else /* pcvt and syscons: hard-code the ID magic */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* PCVT_SUPPORT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* WSCONS_SUPPORT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013)
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Include these definitions in case ioctl_pc.h didn't get included */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* __bsdi__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* !LINKKIT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* This is the QNX code for Watcom 10.6 and QNX 4.x */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if defined(QNX4)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Warning: by default, the fd_set size is 32 in QNX! */
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* keyboard types */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* This is the Neutrino code for for NTO2.0 and GCC */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Warning: by default, the fd_set size is 32 in NTO! */
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* keyboard types */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if defined(sgi)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Generic */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/**************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <sys/wait.h> /* May need to adjust this for other OSs */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * and it's safe, so just do it.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* !O_NDELAY && O_NONBLOCK */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* !MAXHOSTNAMELEN */
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* _POSIX_SOURCE */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* !X_NOT_POSIX */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#if !defined(PATH_MAX)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* MAXPATHLEN */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* !PATH_MAX */
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern char *sys_errlist[];
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error"
45e9809aff7304721fddb95654901b32195c9c7avboxsync# endif /* !strerror */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* NEED_STRERROR */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* _XF86_OSLIB_H */