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