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