mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 01:34:11 +00:00
xfree86: common: move public SDK headers to include/
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
1cc06b8d60
commit
a1081d7765
@@ -519,6 +519,10 @@ if build_xorg
|
||||
'xf86Module.h',
|
||||
'xf86Xinput.h',
|
||||
'xf86sbusBus.h',
|
||||
'xf86Sbus.h',
|
||||
'xf86Pci.h',
|
||||
'xf86_OSlib.h',
|
||||
'xf86_OSproc.h',
|
||||
'xisb.h',
|
||||
'xkbsrv.h',
|
||||
'xkbstr.h',
|
||||
@@ -547,4 +551,9 @@ if build_xorg
|
||||
if build_mitshm
|
||||
install_data(['shmint.h'], install_dir: xorgsdkdir)
|
||||
endif
|
||||
|
||||
if get_option('pciaccess') and host_machine.cpu_family() in ['sparc', 'sparc64']
|
||||
install_data('xf86Sbus.h', install_dir: xorgsdkdir)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
234
include/xf86Pci.h
Normal file
234
include/xf86Pci.h
Normal file
@@ -0,0 +1,234 @@
|
||||
/*
|
||||
* Copyright 1998 by Concurrent Computer Corporation
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and that
|
||||
* both that copyright notice and this permission notice appear in
|
||||
* supporting documentation, and that the name of Concurrent Computer
|
||||
* Corporation not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior
|
||||
* permission. Concurrent Computer Corporation makes no representations
|
||||
* about the suitability of this software for any purpose. It is
|
||||
* provided "as is" without express or implied warranty.
|
||||
*
|
||||
* CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
|
||||
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
|
||||
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
|
||||
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Copyright 1998 by Metro Link Incorporated
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and that
|
||||
* both that copyright notice and this permission notice appear in
|
||||
* supporting documentation, and that the name of Metro Link
|
||||
* Incorporated not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior
|
||||
* permission. Metro Link Incorporated makes no representations
|
||||
* about the suitability of this software for any purpose. It is
|
||||
* provided "as is" without express or implied warranty.
|
||||
*
|
||||
* METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
|
||||
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
|
||||
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
|
||||
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*
|
||||
* This file is derived in part from the original xf86_PCI.h that included
|
||||
* following copyright message:
|
||||
*
|
||||
* Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the names of the above listed copyright holder(s)
|
||||
* not be used in advertising or publicity pertaining to distribution of
|
||||
* the software without specific, written prior permission. The above listed
|
||||
* copyright holder(s) make(s) no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
|
||||
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
|
||||
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
|
||||
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1999-2003 by The XFree86 Project, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of the copyright holder(s)
|
||||
* and author(s) shall not be used in advertising or otherwise to promote
|
||||
* the sale, use or other dealings in this Software without prior written
|
||||
* authorization from the copyright holder(s) and author(s).
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains just the public interface to the PCI code.
|
||||
* Drivers should use this file rather than Pci.h.
|
||||
*/
|
||||
|
||||
#ifndef _XF86PCI_H
|
||||
#define _XF86PCI_H 1
|
||||
#include <X11/Xarch.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include "misc.h"
|
||||
#include <pciaccess.h>
|
||||
|
||||
/*
|
||||
* PCI cfg space definitions (e.g. stuff right out of the PCI spec)
|
||||
*/
|
||||
|
||||
/* Device identification register */
|
||||
#define PCI_ID_REG 0x00
|
||||
|
||||
/* Command and status register */
|
||||
#define PCI_CMD_STAT_REG 0x04
|
||||
#define PCI_CMD_BASE_REG 0x10
|
||||
#define PCI_CMD_BIOS_REG 0x30
|
||||
#define PCI_CMD_MASK 0xffff
|
||||
#define PCI_CMD_IO_ENABLE 0x01
|
||||
#define PCI_CMD_MEM_ENABLE 0x02
|
||||
#define PCI_CMD_MASTER_ENABLE 0x04
|
||||
#define PCI_CMD_SPECIAL_ENABLE 0x08
|
||||
#define PCI_CMD_INVALIDATE_ENABLE 0x10
|
||||
#define PCI_CMD_PALETTE_ENABLE 0x20
|
||||
#define PCI_CMD_PARITY_ENABLE 0x40
|
||||
#define PCI_CMD_STEPPING_ENABLE 0x80
|
||||
#define PCI_CMD_SERR_ENABLE 0x100
|
||||
#define PCI_CMD_BACKTOBACK_ENABLE 0x200
|
||||
#define PCI_CMD_BIOS_ENABLE 0x01
|
||||
|
||||
/* base class */
|
||||
#define PCI_CLASS_REG 0x08
|
||||
#define PCI_CLASS_MASK 0xff000000
|
||||
#define PCI_CLASS_SHIFT 24
|
||||
#define PCI_CLASS_EXTRACT(x) \
|
||||
(((x) & PCI_CLASS_MASK) >> PCI_CLASS_SHIFT)
|
||||
|
||||
/* base class values */
|
||||
#define PCI_CLASS_PREHISTORIC 0x00
|
||||
#define PCI_CLASS_MASS_STORAGE 0x01
|
||||
#define PCI_CLASS_NETWORK 0x02
|
||||
#define PCI_CLASS_DISPLAY 0x03
|
||||
#define PCI_CLASS_MULTIMEDIA 0x04
|
||||
#define PCI_CLASS_MEMORY 0x05
|
||||
#define PCI_CLASS_BRIDGE 0x06
|
||||
#define PCI_CLASS_COMMUNICATIONS 0x07
|
||||
#define PCI_CLASS_SYSPERIPH 0x08
|
||||
#define PCI_CLASS_INPUT 0x09
|
||||
#define PCI_CLASS_DOCKING 0x0a
|
||||
#define PCI_CLASS_PROCESSOR 0x0b
|
||||
#define PCI_CLASS_SERIALBUS 0x0c
|
||||
#define PCI_CLASS_WIRELESS 0x0d
|
||||
#define PCI_CLASS_I2O 0x0e
|
||||
#define PCI_CLASS_SATELLITE 0x0f
|
||||
#define PCI_CLASS_CRYPT 0x10
|
||||
#define PCI_CLASS_DATA_ACQUISTION 0x11
|
||||
#define PCI_CLASS_UNDEFINED 0xff
|
||||
|
||||
/* sub class */
|
||||
#define PCI_SUBCLASS_MASK 0x00ff0000
|
||||
#define PCI_SUBCLASS_SHIFT 16
|
||||
#define PCI_SUBCLASS_EXTRACT(x) \
|
||||
(((x) & PCI_SUBCLASS_MASK) >> PCI_SUBCLASS_SHIFT)
|
||||
|
||||
/* Sub class values */
|
||||
/* 0x00 prehistoric subclasses */
|
||||
#define PCI_SUBCLASS_PREHISTORIC_MISC 0x00
|
||||
#define PCI_SUBCLASS_PREHISTORIC_VGA 0x01
|
||||
|
||||
/* 0x03 display subclasses */
|
||||
#define PCI_SUBCLASS_DISPLAY_VGA 0x00
|
||||
#define PCI_SUBCLASS_DISPLAY_XGA 0x01
|
||||
#define PCI_SUBCLASS_DISPLAY_MISC 0x80
|
||||
|
||||
/* 0x04 multimedia subclasses */
|
||||
#define PCI_SUBCLASS_MULTIMEDIA_VIDEO 0x00
|
||||
#define PCI_SUBCLASS_MULTIMEDIA_AUDIO 0x01
|
||||
#define PCI_SUBCLASS_MULTIMEDIA_MISC 0x80
|
||||
|
||||
/* 0x06 bridge subclasses */
|
||||
#define PCI_SUBCLASS_BRIDGE_HOST 0x00
|
||||
#define PCI_SUBCLASS_BRIDGE_ISA 0x01
|
||||
#define PCI_SUBCLASS_BRIDGE_EISA 0x02
|
||||
#define PCI_SUBCLASS_BRIDGE_MC 0x03
|
||||
#define PCI_SUBCLASS_BRIDGE_PCI 0x04
|
||||
#define PCI_SUBCLASS_BRIDGE_PCMCIA 0x05
|
||||
#define PCI_SUBCLASS_BRIDGE_NUBUS 0x06
|
||||
#define PCI_SUBCLASS_BRIDGE_CARDBUS 0x07
|
||||
#define PCI_SUBCLASS_BRIDGE_RACEWAY 0x08
|
||||
#define PCI_SUBCLASS_BRIDGE_MISC 0x80
|
||||
#define PCI_IF_BRIDGE_PCI_SUBTRACTIVE 0x01
|
||||
|
||||
/* 0x0b processor subclasses */
|
||||
#define PCI_SUBCLASS_PROCESSOR_386 0x00
|
||||
#define PCI_SUBCLASS_PROCESSOR_486 0x01
|
||||
#define PCI_SUBCLASS_PROCESSOR_PENTIUM 0x02
|
||||
#define PCI_SUBCLASS_PROCESSOR_ALPHA 0x10
|
||||
#define PCI_SUBCLASS_PROCESSOR_POWERPC 0x20
|
||||
#define PCI_SUBCLASS_PROCESSOR_MIPS 0x30
|
||||
#define PCI_SUBCLASS_PROCESSOR_COPROC 0x40
|
||||
|
||||
/* PCI-PCI bridge mapping registers */
|
||||
#define PCI_PCI_BRIDGE_BUS_REG 0x18
|
||||
#define PCI_SUBORDINATE_BUS_MASK 0x00ff0000
|
||||
#define PCI_SECONDARY_BUS_MASK 0x0000ff00
|
||||
#define PCI_PRIMARY_BUS_MASK 0x000000ff
|
||||
|
||||
#define PCI_PCI_BRIDGE_IO_REG 0x1c
|
||||
#define PCI_PCI_BRIDGE_MEM_REG 0x20
|
||||
#define PCI_PCI_BRIDGE_PMEM_REG 0x24
|
||||
|
||||
#define PCI_PCI_BRIDGE_CONTROL_REG 0x3E
|
||||
#define PCI_PCI_BRIDGE_PARITY_EN 0x01
|
||||
#define PCI_PCI_BRIDGE_SERR_EN 0x02
|
||||
#define PCI_PCI_BRIDGE_ISA_EN 0x04
|
||||
#define PCI_PCI_BRIDGE_VGA_EN 0x08
|
||||
#define PCI_PCI_BRIDGE_MASTER_ABORT_EN 0x20
|
||||
#define PCI_PCI_BRIDGE_SECONDARY_RESET 0x40
|
||||
#define PCI_PCI_BRIDGE_FAST_B2B_EN 0x80
|
||||
|
||||
/* Subsystem identification register */
|
||||
#define PCI_SUBSYSTEM_ID_REG 0x2c
|
||||
|
||||
/* User defined cfg space regs */
|
||||
#define PCI_REG_USERCONFIG 0x40
|
||||
#define PCI_OPTION_REG 0x40
|
||||
|
||||
/* Public PCI access functions */
|
||||
extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *dev);
|
||||
|
||||
#endif /* _XF86PCI_H */
|
||||
66
include/xf86Sbus.h
Normal file
66
include/xf86Sbus.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Platform specific SBUS and OpenPROM access declarations.
|
||||
*
|
||||
* Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _XF86_SBUS_H
|
||||
#define _XF86_SBUS_H
|
||||
|
||||
#include <xorg-config.h>
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <asm/types.h>
|
||||
#include <linux/fb.h>
|
||||
#include <asm/fbio.h>
|
||||
#include <asm/openpromio.h>
|
||||
#elif defined(SVR4)
|
||||
#include <sys/fbio.h>
|
||||
#include <sys/openpromio.h>
|
||||
#elif defined(__OpenBSD__) && defined(__sparc64__)
|
||||
/* XXX */
|
||||
#elif defined(CSRG_BASED)
|
||||
#if defined(__FreeBSD__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/fbio.h>
|
||||
#include <dev/ofw/openpromio.h>
|
||||
#else
|
||||
#include <machine/fbio.h>
|
||||
#endif
|
||||
#else
|
||||
#include <sun/fbio.h>
|
||||
#endif
|
||||
|
||||
#ifndef FBTYPE_SUNGP3
|
||||
#define FBTYPE_SUNGP3 -1
|
||||
#endif
|
||||
#ifndef FBTYPE_MDICOLOR
|
||||
#define FBTYPE_MDICOLOR -1
|
||||
#endif
|
||||
#ifndef FBTYPE_SUNLEO
|
||||
#define FBTYPE_SUNLEO -1
|
||||
#endif
|
||||
#ifndef FBTYPE_TCXCOLOR
|
||||
#define FBTYPE_TCXCOLOR -1
|
||||
#endif
|
||||
#ifndef FBTYPE_CREATOR
|
||||
#define FBTYPE_CREATOR -1
|
||||
#endif
|
||||
|
||||
#endif /* _XF86_SBUS_H */
|
||||
241
include/xf86_OSlib.h
Normal file
241
include/xf86_OSlib.h
Normal file
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
|
||||
* Copyright 1992 by David Dawes <dawes@XFree86.org>
|
||||
* Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
|
||||
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
|
||||
* Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
|
||||
* Copyright 1992 by Orest Zborowski <obz@eskimo.com>
|
||||
* Copyright 1993 by Vrije Universiteit, The Netherlands
|
||||
* Copyright 1993 by David Wexelblat <dwex@XFree86.org>
|
||||
* Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
|
||||
* Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
|
||||
* Copyright 1994-2003 by The XFree86 Project, Inc
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the names of the above listed copyright holders
|
||||
* not be used in advertising or publicity pertaining to distribution of
|
||||
* the software without specific, written prior permission. The above listed
|
||||
* copyright holders make no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
|
||||
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
|
||||
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The ARM32 code here carries the following copyright:
|
||||
*
|
||||
* Copyright 1997
|
||||
* Digital Equipment Corporation. All rights reserved.
|
||||
* This software is furnished under license and may be used and copied only in
|
||||
* accordance with the following terms and conditions. Subject to these
|
||||
* conditions, you may download, copy, install, use, modify and distribute
|
||||
* this software in source and/or binary form. No title or ownership is
|
||||
* transferred hereby.
|
||||
*
|
||||
* 1) Any source code used, modified or distributed must reproduce and retain
|
||||
* this copyright notice and list of conditions as they appear in the
|
||||
* source file.
|
||||
*
|
||||
* 2) No right is granted to use any trade name, trademark, or logo of Digital
|
||||
* Equipment Corporation. Neither the "Digital Equipment Corporation"
|
||||
* name nor any trademark or logo of Digital Equipment Corporation may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* the prior written permission of Digital Equipment Corporation.
|
||||
*
|
||||
* 3) This software is provided "AS-IS" and any express or implied warranties,
|
||||
* including but not limited to, any implied warranties of merchantability,
|
||||
* fitness for a particular purpose, or non-infringement are disclaimed.
|
||||
* In no event shall DIGITAL be liable for any damages whatsoever, and in
|
||||
* particular, DIGITAL shall not be liable for special, indirect,
|
||||
* consequential, or incidental damages or damages for lost profits, loss
|
||||
* of revenue or loss of use, whether such damages arise in contract,
|
||||
* negligence, tort, under statute, in equity, at law or otherwise, even
|
||||
* if advised of the possibility of such damage.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is private, and should not be included by any drivers. Drivers
|
||||
* may include xf86_OSproc.h to get prototypes for public interfaces.
|
||||
*/
|
||||
|
||||
#ifndef _XF86_OSLIB_H
|
||||
#define _XF86_OSLIB_H
|
||||
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/**************************************************************************/
|
||||
/* Solaris or illumos-based system */
|
||||
/**************************************************************************/
|
||||
#if defined(__SVR4) && defined(__sun)
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
#include <termio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_SYS_VT_H
|
||||
#define HAS_USL_VTS
|
||||
#endif
|
||||
#ifdef HAS_USL_VTS
|
||||
#include <sys/kd.h>
|
||||
#include <sys/vt.h>
|
||||
#endif
|
||||
|
||||
#define CLEARDTR_SUPPORT
|
||||
|
||||
#endif /* SVR4 && __sun */
|
||||
|
||||
/**************************************************************************/
|
||||
/* Linux or Glibc-based system */
|
||||
/**************************************************************************/
|
||||
#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <termios.h>
|
||||
#ifdef __sparc__
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __linux__
|
||||
#define HAS_USL_VTS
|
||||
#include <sys/kd.h>
|
||||
#include <sys/vt.h>
|
||||
#define LDGMAP GIO_SCRNMAP
|
||||
#define LDSMAP PIO_SCRNMAP
|
||||
#define LDNMAP LDSMAP
|
||||
#define CLEARDTR_SUPPORT
|
||||
#endif
|
||||
|
||||
#endif /* __linux__ || __GLIBC__ */
|
||||
|
||||
/**************************************************************************/
|
||||
/* System is BSD-like */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifdef CSRG_BASED
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <termios.h>
|
||||
#define termio termios
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#endif /* CSRG_BASED */
|
||||
|
||||
/**************************************************************************/
|
||||
/* Kernel of *BSD */
|
||||
/**************************************************************************/
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
|
||||
defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
|
||||
#include <sys/param.h>
|
||||
#if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
|
||||
#define __FreeBSD_kernel_version __FreeBSD_version
|
||||
#endif
|
||||
|
||||
#ifdef SYSCONS_SUPPORT
|
||||
#define COMPAT_SYSCONS
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
||||
#if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
|
||||
#include <sys/consio.h>
|
||||
#include <sys/kbio.h>
|
||||
#else
|
||||
#include <machine/console.h>
|
||||
#endif /* FreeBSD 4.1 RELEASE or lator */
|
||||
#else
|
||||
#include <sys/console.h>
|
||||
#endif
|
||||
#endif /* SYSCONS_SUPPORT */
|
||||
#if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
#if !defined(SYSCONS_SUPPORT)
|
||||
/* no syscons, so include pcvt specific header file */
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#include <machine/pcvt_ioctl.h>
|
||||
#else
|
||||
#include <sys/pcvt_ioctl.h>
|
||||
#endif /* __FreeBSD_kernel__ */
|
||||
#else /* pcvt and syscons: hard-code the ID magic */
|
||||
#define VGAPCVTID _IOWR('V',113, struct pcvtid)
|
||||
struct pcvtid {
|
||||
char name[16];
|
||||
int rmajor, rminor;
|
||||
};
|
||||
#endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
|
||||
#endif /* PCVT_SUPPORT */
|
||||
#ifdef WSCONS_SUPPORT
|
||||
#include <dev/wscons/wsconsio.h>
|
||||
#include <dev/wscons/wsdisplay_usl_io.h>
|
||||
#endif /* WSCONS_SUPPORT */
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
||||
#include <sys/mouse.h>
|
||||
#endif
|
||||
/* Include these definitions in case ioctl_pc.h didn't get included */
|
||||
#ifndef CONSOLE_X_BELL
|
||||
#define CONSOLE_X_BELL _IOW('t',123,int[2])
|
||||
#endif
|
||||
|
||||
#define CLEARDTR_SUPPORT
|
||||
|
||||
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
|
||||
/**************************************************************************/
|
||||
/* IRIX */
|
||||
/**************************************************************************/
|
||||
|
||||
/**************************************************************************/
|
||||
/* Generic */
|
||||
/**************************************************************************/
|
||||
|
||||
/* For PATH_MAX */
|
||||
#include "misc.h"
|
||||
|
||||
/*
|
||||
* Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
|
||||
* and it's safe, so just do it.
|
||||
*/
|
||||
#if !defined(O_NDELAY) && defined(O_NONBLOCK)
|
||||
#define O_NDELAY O_NONBLOCK
|
||||
#endif /* !O_NDELAY && O_NONBLOCK */
|
||||
|
||||
#if !defined(MAXHOSTNAMELEN)
|
||||
#define MAXHOSTNAMELEN 32
|
||||
#endif /* !MAXHOSTNAMELEN */
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#ifndef MAP_FAILED
|
||||
#define MAP_FAILED ((void *)-1)
|
||||
#endif
|
||||
|
||||
#define SYSCALL(call) while(((call) == -1) && (errno == EINTR)) {}
|
||||
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
#endif /* _XF86_OSLIB_H */
|
||||
150
include/xf86_OSproc.h
Normal file
150
include/xf86_OSproc.h
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
|
||||
* Copyright 1992 by David Dawes <dawes@XFree86.org>
|
||||
* Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
|
||||
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
|
||||
* Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
|
||||
* Copyright 1992 by Orest Zborowski <obz@eskimo.com>
|
||||
* Copyright 1993 by Vrije Universiteit, The Netherlands
|
||||
* Copyright 1993 by David Wexelblat <dwex@XFree86.org>
|
||||
* Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
|
||||
* Copyright 1994-2003 by The XFree86 Project, Inc
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the names of the above listed copyright holders
|
||||
* not be used in advertising or publicity pertaining to distribution of
|
||||
* the software without specific, written prior permission. The above listed
|
||||
* copyright holders make no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
|
||||
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
|
||||
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The ARM32 code here carries the following copyright:
|
||||
*
|
||||
* Copyright 1997
|
||||
* Digital Equipment Corporation. All rights reserved.
|
||||
* This software is furnished under license and may be used and copied only in
|
||||
* accordance with the following terms and conditions. Subject to these
|
||||
* conditions, you may download, copy, install, use, modify and distribute
|
||||
* this software in source and/or binary form. No title or ownership is
|
||||
* transferred hereby.
|
||||
*
|
||||
* 1) Any source code used, modified or distributed must reproduce and retain
|
||||
* this copyright notice and list of conditions as they appear in the
|
||||
* source file.
|
||||
*
|
||||
* 2) No right is granted to use any trade name, trademark, or logo of Digital
|
||||
* Equipment Corporation. Neither the "Digital Equipment Corporation"
|
||||
* name nor any trademark or logo of Digital Equipment Corporation may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* the prior written permission of Digital Equipment Corporation.
|
||||
*
|
||||
* 3) This software is provided "AS-IS" and any express or implied warranties,
|
||||
* including but not limited to, any implied warranties of merchantability,
|
||||
* fitness for a particular purpose, or non-infringement are disclaimed.
|
||||
* In no event shall DIGITAL be liable for any damages whatsoever, and in
|
||||
* particular, DIGITAL shall not be liable for special, indirect,
|
||||
* consequential, or incidental damages or damages for lost profits, loss
|
||||
* of revenue or loss of use, whether such damages arise in contract,
|
||||
* negligence, tort, under statute, in equity, at law or otherwise, even
|
||||
* if advised of the possibility of such damage.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _XF86_OSPROC_H
|
||||
#define _XF86_OSPROC_H
|
||||
|
||||
/*
|
||||
* The actual prototypes have been pulled into this separate file so
|
||||
* that they can can be used without pulling in all of the OS specific
|
||||
* stuff like sys/stat.h, etc. that causes problems for loadable modules.
|
||||
*/
|
||||
|
||||
/*
|
||||
* OS-independent modem state flags for xf86SetSerialModemState() and
|
||||
* xf86GetSerialModemState().
|
||||
*/
|
||||
#define XF86_M_LE 0x001 /* line enable */
|
||||
#define XF86_M_DTR 0x002 /* data terminal ready */
|
||||
#define XF86_M_RTS 0x004 /* request to send */
|
||||
#define XF86_M_ST 0x008 /* secondary transmit */
|
||||
#define XF86_M_SR 0x010 /* secondary receive */
|
||||
#define XF86_M_CTS 0x020 /* clear to send */
|
||||
#define XF86_M_CAR 0x040 /* carrier detect */
|
||||
#define XF86_M_RNG 0x080 /* ring */
|
||||
#define XF86_M_DSR 0x100 /* data set ready */
|
||||
|
||||
/***************************************************************************/
|
||||
/* Prototypes */
|
||||
/***************************************************************************/
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include "opaque.h"
|
||||
#include "xf86Optionstr.h"
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
/* public functions */
|
||||
extern _X_EXPORT Bool xf86EnableIO(void);
|
||||
extern _X_EXPORT void xf86DisableIO(void);
|
||||
|
||||
extern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int);
|
||||
extern _X_EXPORT int xf86OpenSerial(XF86OptionPtr options);
|
||||
extern _X_EXPORT int xf86SetSerial(int fd, XF86OptionPtr options);
|
||||
extern _X_EXPORT int xf86SetSerialSpeed(int fd, int speed);
|
||||
extern _X_EXPORT int xf86ReadSerial(int fd, void *buf, int count);
|
||||
extern _X_EXPORT int xf86WriteSerial(int fd, const void *buf, int count);
|
||||
extern _X_EXPORT int xf86CloseSerial(int fd);
|
||||
extern _X_EXPORT int xf86FlushInput(int fd);
|
||||
extern _X_EXPORT int xf86WaitForInput(int fd, int timeout);
|
||||
extern _X_EXPORT int xf86SetSerialModemState(int fd, int state);
|
||||
extern _X_EXPORT int xf86GetSerialModemState(int fd);
|
||||
extern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits);
|
||||
extern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits);
|
||||
extern _X_EXPORT int xf86LoadKernelModule(const char *pathname);
|
||||
|
||||
/* AGP GART interface */
|
||||
|
||||
typedef struct _AgpInfo {
|
||||
CARD32 bridgeId;
|
||||
CARD32 agpMode;
|
||||
unsigned long base;
|
||||
unsigned long size;
|
||||
unsigned long totalPages;
|
||||
unsigned long systemPages;
|
||||
unsigned long usedPages;
|
||||
} AgpInfo, *AgpInfoPtr;
|
||||
|
||||
extern _X_EXPORT Bool xf86AgpGARTSupported(void);
|
||||
extern _X_EXPORT AgpInfoPtr xf86GetAGPInfo(int screenNum);
|
||||
extern _X_EXPORT Bool xf86AcquireGART(int screenNum);
|
||||
extern _X_EXPORT Bool xf86ReleaseGART(int screenNum);
|
||||
extern _X_EXPORT int xf86AllocateGARTMemory(int screenNum, unsigned long size,
|
||||
int type, unsigned long *physical);
|
||||
extern _X_EXPORT Bool xf86BindGARTMemory(int screenNum, int key,
|
||||
unsigned long offset);
|
||||
extern _X_EXPORT Bool xf86UnbindGARTMemory(int screenNum, int key);
|
||||
extern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum);
|
||||
|
||||
/* These routines are in shared/sigio.c and are not loaded as part of the
|
||||
module. These routines are small, and the code if very POSIX-signal (or
|
||||
OS-signal) specific, so it seemed better to provide more complex
|
||||
wrappers than to wrap each individual function called. */
|
||||
extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *),
|
||||
void *);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
#endif /* _XF86_OSPROC_H */
|
||||
Reference in New Issue
Block a user