a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1998 by Concurrent Computer Corporation
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission to use, copy, modify, distribute, and sell this software
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * and its documentation for any purpose is hereby granted without fee,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * provided that the above copyright notice appear in all copies and that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * both that copyright notice and this permission notice appear in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * supporting documentation, and that the name of Concurrent Computer
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Corporation not be used in advertising or publicity pertaining to
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * distribution of the software without specific, written prior
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * permission. Concurrent Computer Corporation makes no representations
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * about the suitability of this software for any purpose. It is
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * provided "as is" without express or implied warranty.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1998 by Metro Link Incorporated
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission to use, copy, modify, distribute, and sell this software
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * and its documentation for any purpose is hereby granted without fee,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * provided that the above copyright notice appear in all copies and that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * both that copyright notice and this permission notice appear in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * supporting documentation, and that the name of Metro Link
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Incorporated not be used in advertising or publicity pertaining to
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * distribution of the software without specific, written prior
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * permission. Metro Link Incorporated makes no representations
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * about the suitability of this software for any purpose. It is
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * provided "as is" without express or implied warranty.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This file is derived in part from the original xf86_PCI.h that included
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * following copyright message:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
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 holder(s)
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 holder(s) make(s) 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 HOLDER(S) DISCLAIM(S) 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 HOLDER(S) 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 * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * copy of this software and associated documentation files (the "Software"),
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * to deal in the Software without restriction, including without limitation
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * and/or sell copies of the Software, and to permit persons to whom the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Software is furnished to do so, subject to the following conditions:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * The above copyright notice and this permission notice shall be included in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * all copies or substantial portions of the Software.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * OTHER DEALINGS IN THE SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Except as contained in this notice, the name of the copyright holder(s)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * and author(s) shall not be used in advertising or otherwise to promote
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the sale, use or other dealings in this Software without prior written
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * authorization from the copyright holder(s) and author(s).
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This file has the private Pci definitions. The public ones are imported
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * from xf86Pci.h. Drivers should not use this file.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef HAVE_XORG_CONFIG_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <xorg-config.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef _PCI_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define _PCI_H 1
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "xf86Pci.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Global Definitions
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_DOM_MASK 0x01fful
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#else
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_DOM_MASK 0x0ffu
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef PCI_DOM_MASK
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_DOM_MASK 0x0ffu
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * "b" contains an optional domain number.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_MAKE_TAG(b,d,f) ((((b) & (PCI_DOMBUS_MASK)) << 16) | \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync (((d) & 0x00001fu) << 11) | \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync (((f) & 0x000007u) << 8))
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_MAKE_BUS(d,b) ((((d) & (PCI_DOM_MASK)) << 8) | ((b) & 0xffu))
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_DOM_FROM_BUS(bus) (((bus) >> 8) & (PCI_DOM_MASK))
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#if defined(linux)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define osPciInit(x) do {} while (0)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync defined(__OpenBSD__) || defined(__NetBSD__) || \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync defined(__DragonFly__) || defined(__sun) || defined(__GNU__)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern void osPciInit(void);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#else
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#error No PCI support available for this architecture/OS combination
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* _PCI_H */