View | Details | Raw Unified | Return to bug 151644
Collapse All | Expand All

(-)programs/Xserver/hw/xfree86/os-support/bus/Pci.c (+14 lines)
Lines 1068-1073 Link Here
1068
    return pci_devp;
1068
    return pci_devp;
1069
}
1069
}
1070
1070
1071
pciConfigPtr
1072
xf86GetPciConfigFromTag(PCITAG Tag)
1073
{
1074
    pciConfigPtr pDev;
1075
    int i = 0;
1076
1077
    for (i = 0 ; (pDev = pci_devp[i]) && i <= MAX_PCI_DEVICES; i++) {
1078
	if (Tag == pDev->tag)
1079
	    return pDev;
1080
    }
1081
1082
    return NULL;	/* Bad data */
1083
}
1084
1071
CARD32
1085
CARD32
1072
pciCheckForBrokenBase(PCITAG Tag,int basereg)
1086
pciCheckForBrokenBase(PCITAG Tag,int basereg)
1073
{
1087
{
(-)programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h (+1 lines)
Lines 780-785 Link Here
780
int	      xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg,
780
int	      xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg,
781
					   PciBiosType *Buf);
781
					   PciBiosType *Buf);
782
pciConfigPtr *xf86scanpci(int flags);
782
pciConfigPtr *xf86scanpci(int flags);
783
pciConfigPtr xf86GetPciConfigFromTag(PCITAG Tag);
783
784
784
extern int pciNumBuses;
785
extern int pciNumBuses;
785
786
(-)programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c (-4 / +4 lines)
Lines 201-206 Link Here
201
            fn = devfn & 0x7;
201
            fn = devfn & 0x7;
202
            if (tag == pciTag(bus,dev,fn)) {
202
            if (tag == pciTag(bus,dev,fn)) {
203
                /* ok now look through all the BAR values of this device */
203
                /* ok now look through all the BAR values of this device */
204
		pciConfigPtr pDev = xf86GetPciConfigFromTag(tag);
205
204
                for (ndx=0; ndx<7; ndx++) {
206
                for (ndx=0; ndx<7; ndx++) {
205
                    unsigned long savePtr;
207
                    unsigned long savePtr;
206
                    /*
208
                    /*
Lines 208-218 Link Here
208
		     * memory attributes
210
		     * memory attributes
209
		     */
211
		     */
210
		    if (ndx == 6) 
212
		    if (ndx == 6) 
211
			savePtr = (0xFFFFFFF0) & 
213
			savePtr = PCIGETROM(pDev->pci_baserom);
212
			    pciReadLong(tag, PCI_CMD_BIOS_REG);
213
		    else /* this the ROM bar */
214
		    else /* this the ROM bar */
214
			savePtr = (0xFFFFFFF0) & 
215
			savePtr = (0xFFFFFFF0) & (&pDev->pci_base0)[ndx];
215
			    pciReadLong(tag, PCI_CMD_BASE_REG + (0x4 * ndx));
216
216
217
                    /* find the index of the incoming base */
217
                    /* find the index of the incoming base */
218
                    if (base >= savePtr && base <= (savePtr + size[ndx])) {
218
                    if (base >= savePtr && base <= (savePtr + size[ndx])) {

Return to bug 151644