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