a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1992 by David Dawes <dawes@XFree86.org>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1993 by Vrije Universiteit, The Netherlands
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1994-2003 by The XFree86 Project, Inc
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission to use, copy, modify, distribute, and sell this software and its
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * documentation for any purpose is hereby granted without fee, provided that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the above copyright notice appear in all copies and that both that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * copyright notice and this permission notice appear in supporting
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * documentation, and that the names of the above listed copyright holders
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * not be used in advertising or publicity pertaining to distribution of
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the software without specific, written prior permission. The above listed
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * copyright holders make no representations about the suitability of this
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * software for any purpose. It is provided "as is" without express or
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * implied warranty.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * The ARM32 code here carries the following copyright:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1997
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Digital Equipment Corporation. All rights reserved.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This software is furnished under license and may be used and copied only in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * accordance with the following terms and conditions. Subject to these
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * conditions, you may download, copy, install, use, modify and distribute
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * this software in source and/or binary form. No title or ownership is
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * transferred hereby.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * 1) Any source code used, modified or distributed must reproduce and retain
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * this copyright notice and list of conditions as they appear in the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * source file.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * 2) No right is granted to use any trade name, trademark, or logo of Digital
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Equipment Corporation. Neither the "Digital Equipment Corporation"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * name nor any trademark or logo of Digital Equipment Corporation may be
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * used to endorse or promote products derived from this software without
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the prior written permission of Digital Equipment Corporation.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * 3) This software is provided "AS-IS" and any express or implied warranties,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * including but not limited to, any implied warranties of merchantability,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * fitness for a particular purpose, or non-infringement are disclaimed.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * In no event shall DIGITAL be liable for any damages whatsoever, and in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * particular, DIGITAL shall not be liable for special, indirect,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * consequential, or incidental damages or damages for lost profits, loss
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * of revenue or loss of use, whether such damages arise in contract,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * negligence, tort, under statute, in equity, at law or otherwise, even
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * if advised of the possibility of such damage.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef _XF86_OSPROC_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define _XF86_OSPROC_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * The actual prototypes have been pulled into this seperate file so
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * that they can can be used without pulling in all of the OS specific
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * stuff like sys/stat.h, etc. This casues problem for loadable modules.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * OS-independent modem state flags for xf86SetSerialModemState() and
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * xf86GetSerialModemState().
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_LE 0x001 /* line enable */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_DTR 0x002 /* data terminal ready */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_RTS 0x004 /* request to send */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_ST 0x008 /* secondary transmit */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_SR 0x010 /* secondary receive */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_CTS 0x020 /* clear to send */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_CAR 0x040 /* carrier detect */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_RNG 0x080 /* ring */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define XF86_M_DSR 0x100 /* data set ready */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef NO_OSLIB_PROTOTYPES
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This is to prevent re-entrancy to FatalError() when aborting.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Anything that can be called as a result of AbortDDX() should use this
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * instead of FatalError().
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define xf86FatalError(a, b) \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync if (dispatchException & DE_TERMINATE) { \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ErrorF(a, b); \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ErrorF("\n"); \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync return; \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync } else FatalError(a, b)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/***************************************************************************/
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* Prototypes */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/***************************************************************************/
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <X11/Xfuncproto.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "opaque.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "xf86Optionstr.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync_XFUNCPROTOBEGIN
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* public functions */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86EnableIO(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86DisableIO(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef __NetBSD__
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86SetTVOut(int);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86SetRGBOut(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86OSRingBell(int, int, int);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86SetReallySlowBcopy(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86OpenSerial(XF86OptionPtr options);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86SetSerial(int fd, XF86OptionPtr options);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86SetSerialSpeed(int fd, int speed);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86ReadSerial(int fd, void *buf, int count);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86WriteSerial(int fd, const void *buf, int count);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86CloseSerial(int fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86FlushInput(int fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86WaitForInput(int fd, int timeout);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86SerialSendBreak(int fd, int duration);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86SetSerialModemState(int fd, int state);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86GetSerialModemState(int fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86LoadKernelModule(const char *pathname);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* AGP GART interface */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _AgpInfo {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD32 bridgeId;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD32 agpMode;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long base;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long size;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long totalPages;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long systemPages;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long usedPages;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} AgpInfo, *AgpInfoPtr;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86AgpGARTSupported(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT AgpInfoPtr xf86GetAGPInfo(int screenNum);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86AcquireGART(int screenNum);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86ReleaseGART(int screenNum);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86AllocateGARTMemory(int screenNum, unsigned long size,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int type, unsigned long *physical);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86DeallocateGARTMemory(int screenNum, int key);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86BindGARTMemory(int screenNum, int key,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long offset);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86UnbindGARTMemory(int screenNum, int key);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86EnableAGP(int screenNum, CARD32 mode);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* These routines are in shared/sigio.c and are not loaded as part of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync module. These routines are small, and the code if very POSIX-signal (or
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync OS-signal) specific, so it seemed better to provide more complex
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync wrappers than to wrap each individual function called. */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *),
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86RemoveSIGIOHandler(int fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86BlockSIGIO(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86UnblockSIGIO(int);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86AssertBlockedSIGIO(char *);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86SIGIOSupported(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef XF86_OS_PRIVS
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*PMClose) (void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86OpenConsole(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86CloseConsole(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_HIDDEN Bool xf86VTActivate(int vtno);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86VTSwitchPending(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86VTSwitchAway(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool xf86VTSwitchTo(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86VTRequest(int sig);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int xf86ProcessArgument(int, char **, int);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86UseMsg(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT PMClose xf86OSPMOpen(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void xf86InitVidMem(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* XF86_OS_PRIVS */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef XSERVER_PLATFORM_BUS
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "hotplug.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncvoid
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncxf86PlatformDeviceProbe(struct OdevAttributes *attribs);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncvoid
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncxf86PlatformReprobeDevice(int index, struct OdevAttributes *attribs);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync_XFUNCPROTOEND
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* NO_OSLIB_PROTOTYPES */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* _XF86_OSPROC_H */