deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * copy of this software and associated documentation files (the "Software"),
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * to deal in the Software without restriction, including without limitation
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and/or sell copies of the Software, and to permit persons to whom the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Software is furnished to do so, subject to the following conditions:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The above copyright notice and this permission notice shall be included in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * all copies or substantial portions of the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OTHER DEALINGS IN THE SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Except as contained in this notice, the name of the copyright holder(s)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and author(s) shall not be used in advertising or otherwise to promote
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the sale, use or other dealings in this Software without prior written
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * authorization from the copyright holder(s) and author(s).
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifdef HAVE_XORG_CONFIG_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#include <xorg-config.h>
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef _XF86_PCI_BUS_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define _XF86_PCI_BUS_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define PCITAG_SPECIAL pciTag(0xFF,0xFF,0xFF)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD32 command;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD32 base[6];
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD32 biosBase;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} pciSave, *pciSavePtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync PCITAG tag;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD32 ctrl;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} pciArg;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int busnum;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int devnum;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int funcnum;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pciArg arg;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync xf86AccessRec ioAccess;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync xf86AccessRec io_memAccess;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync xf86AccessRec memAccess;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pciSave save;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync pciSave restore;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool ctrl;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} pciAccRec, *pciAccPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef union {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CARD16 control;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} pciBridgesSave, *pciBridgesSavePtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct pciBusRec {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int brbus, brdev, brfunc; /* ID of the bridge to this bus */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int primary, secondary, subordinate;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int subclass; /* bridge type */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int interface;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync resPtr preferred_io; /* I/O range */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync resPtr preferred_mem; /* non-prefetchable memory range */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync resPtr preferred_pmem; /* prefetchable memory range */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync resPtr io; /* for subtractive PCI-PCI bridges */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync resPtr mem;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync resPtr pmem;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int brcontrol; /* bridge_control byte */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync struct pciBusRec *next;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} PciBusRec, *PciBusPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid xf86PciProbe(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid ValidatePci(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncresList GetImplicitPciResources(int entityIndex);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid initPciState(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid initPciBusState(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid DisablePciAccess(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid DisablePciBusAccess(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid PciStateEnter(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid PciBusStateEnter(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid PciStateLeave(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid PciBusStateLeave(void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncresPtr ResourceBrokerInitPci(resPtr *osRes);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid pciConvertRange2Host(int entityIndex, resRange *pRange);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid isaConvertRange2Host(resRange *pRange);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern pciAccPtr * xf86PciAccInfo;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* _XF86_PCI_BUS_H */