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