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