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

(-)programs/Xserver/hw/xfree86/int10/helper_exec.c (-2 / +2 lines)
Lines 478-484 Link Here
478
	return 1;
478
	return 1;
479
    }
479
    }
480
    if (addr == 0xCFC) {
480
    if (addr == 0xCFC) {
481
	*val = pciReadLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr));
481
	*val = pciReadLong(Int10Current->Tag, OFFSET(PciCfg1Addr));
482
	return 1;
482
	return 1;
483
    }
483
    }
484
    return 0;
484
    return 0;
Lines 492-498 Link Here
492
	return 1;
492
	return 1;
493
    }
493
    }
494
    if (addr == 0xCFC) {
494
    if (addr == 0xCFC) {
495
	pciWriteLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr), val);
495
	pciWriteLong(Int10Current->Tag, OFFSET(PciCfg1Addr),val);
496
	return 1;
496
	return 1;
497
    }
497
    }
498
    return 0;
498
    return 0;
(-)programs/Xserver/hw/xfree86/os-support/bus/Pci.c (+10 lines)
Lines 597-602 Link Here
597
  return bits;
597
  return bits;
598
}
598
}
599
599
600
void
601
pciInfoFromTag(PCITAG tag, int *domainnum, int *busnum,
602
               int *devnum, int *funcnum)
603
{
604
    *domainnum = PCI_DOM_FROM_TAG(tag);
605
    *busnum = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(tag));
606
    *devnum = PCI_DEV_FROM_TAG(tag);
607
    *funcnum = PCI_FUNC_FROM_TAG(tag);
608
}
609
600
PCITAG
610
PCITAG
601
pciTag(int busnum, int devnum, int funcnum)
611
pciTag(int busnum, int devnum, int funcnum)
602
{
612
{
(-)programs/Xserver/hw/xfree86/os-support/bus/Pci.h (-2 / +2 lines)
Lines 120-126 Link Here
120
				/* by xf86scanpci		     */
120
				/* by xf86scanpci		     */
121
#if defined(sun) && defined(SVR4) && defined(sparc)
121
#if defined(sun) && defined(SVR4) && defined(sparc)
122
# define MAX_PCI_BUSES   4096	/* Max number of PCI buses           */
122
# define MAX_PCI_BUSES   4096	/* Max number of PCI buses           */
123
#elif defined(__alpha__) && defined (linux)
123
#elif (defined(__alpha__) || defined(__ia64__)) && defined (linux)
124
# define MAX_PCI_DOMAINS	512
124
# define MAX_PCI_DOMAINS	512
125
# define PCI_DOM_MASK	0x01fful
125
# define PCI_DOM_MASK	0x01fful
126
# define MAX_PCI_BUSES	(MAX_PCI_DOMAINS*256) /* 256 per domain      */
126
# define MAX_PCI_BUSES	(MAX_PCI_DOMAINS*256) /* 256 per domain      */
Lines 259-265 Link Here
259
# endif
259
# endif
260
#elif defined(__ia64__)
260
#elif defined(__ia64__)
261
# if defined(linux)
261
# if defined(linux)
262
#  define ARCH_PCI_INIT linuxPciInit
262
#  define ARCH_PCI_INIT ia64linuxPciInit
263
#  define INCLUDE_XF86_MAP_PCI_MEM
263
#  define INCLUDE_XF86_MAP_PCI_MEM
264
# elif defined(FreeBSD)
264
# elif defined(FreeBSD)
265
#  define ARCH_PCI_INIT freebsdPciInit
265
#  define ARCH_PCI_INIT freebsdPciInit
(-)programs/Xserver/hw/xfree86/os-support/bus/altixPCI.c (-3 / +6 lines)
Lines 41-53 Link Here
41
static void get_bridge_info(pciBusInfo_t *bus_info, pciDevice *pdev)
41
static void get_bridge_info(pciBusInfo_t *bus_info, pciDevice *pdev)
42
{
42
{
43
	unsigned int parent_segnum, segnum = PCI_DOM_FROM_TAG(pdev->tag);
43
	unsigned int parent_segnum, segnum = PCI_DOM_FROM_TAG(pdev->tag);
44
	unsigned int parent_busnum, busnum = pdev->busnum;
44
	unsigned int parent_busnum, parent_nodombus, busnum = pdev->busnum;
45
	unsigned int nodombus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(pdev->tag));
45
	char bridge_path[] = "/sys/class/pci_bus/0000:00/bridge";
46
	char bridge_path[] = "/sys/class/pci_bus/0000:00/bridge";
46
	char bridge_target[] = "../../../devices/pci0000:00";
47
	char bridge_target[] = "../../../devices/pci0000:00";
47
48
48
	/* Path to this device's bridge */
49
	/* Path to this device's bridge */
49
	sprintf(bridge_path, "/sys/class/pci_bus/%04x:%02x/bridge", segnum,
50
	sprintf(bridge_path, "/sys/class/pci_bus/%04x:%02x/bridge", segnum,
50
		busnum);
51
		nodombus);
51
52
52
	if (readlink(bridge_path, bridge_target, strlen(bridge_target)) < 0) {
53
	if (readlink(bridge_path, bridge_target, strlen(bridge_target)) < 0) {
53
		perror("failed to dereference bridge link");
54
		perror("failed to dereference bridge link");
Lines 56-62 Link Here
56
	}
57
	}
57
58
58
	sscanf(bridge_target, "../../../devices/pci%04x:%02x", &parent_segnum,
59
	sscanf(bridge_target, "../../../devices/pci%04x:%02x", &parent_segnum,
59
	       &parent_busnum);
60
	       &parent_nodombus);
61
62
	parent_busnum = PCI_MAKE_BUS(parent_segnum, parent_nodombus);
60
63
61
	/*
64
	/*
62
	 * If there's no bridge or the bridge points to the device, use
65
	 * If there's no bridge or the bridge points to the device, use
(-)programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c (-22 / +172 lines)
Lines 55-60 Link Here
55
#include "xf86Priv.h"
55
#include "xf86Priv.h"
56
#include "xf86_OSlib.h"
56
#include "xf86_OSlib.h"
57
#include "Pci.h"
57
#include "Pci.h"
58
#include <dirent.h>
58
59
59
/*
60
/*
60
 * linux platform specific PCI access functions -- using /proc/bus/pci
61
 * linux platform specific PCI access functions -- using /proc/bus/pci
Lines 73-78 Link Here
73
static void linuxPciCfgWriteByte(PCITAG tag, int off, CARD8 val);
74
static void linuxPciCfgWriteByte(PCITAG tag, int off, CARD8 val);
74
static CARD16 linuxPciCfgReadWord(PCITAG tag, int off);
75
static CARD16 linuxPciCfgReadWord(PCITAG tag, int off);
75
static void linuxPciCfgWriteWord(PCITAG tag, int off, CARD16 val);
76
static void linuxPciCfgWriteWord(PCITAG tag, int off, CARD16 val);
77
static Bool linuxDomainSupport(void);
76
78
77
static pciBusFuncs_t linuxFuncs0 = {
79
static pciBusFuncs_t linuxFuncs0 = {
78
/* pciReadLong      */	linuxPciCfgRead,
80
/* pciReadLong      */	linuxPciCfgRead,
Lines 111-116 Link Here
111
/* bridge      */	NULL
113
/* bridge      */	NULL
112
};
114
};
113
115
116
static Bool	domain_support = FALSE;
117
114
void
118
void
115
linuxPciInit()
119
linuxPciInit()
116
{
120
{
Lines 121-163 Link Here
121
		   we'll need a fallback for 2.0 kernels here */
125
		   we'll need a fallback for 2.0 kernels here */
122
		return;
126
		return;
123
	}
127
	}
128
	
129
	domain_support = linuxDomainSupport();
130
124
	pciNumBuses    = 1;
131
	pciNumBuses    = 1;
125
	pciBusInfo[0]  = &linuxPci0;
132
	pciBusInfo[0]  = &linuxPci0;
126
	pciFindFirstFP = pciGenFindFirst;
133
	pciFindFirstFP = pciGenFindFirst;
127
	pciFindNextFP  = pciGenFindNext;
134
	pciFindNextFP  = pciGenFindNext;
135
136
	return;
128
}
137
}
129
138
130
static int
139
static int
131
linuxPciOpenFile(PCITAG tag, Bool write)
140
linuxPciOpenFile(PCITAG tag, Bool write)
132
{
141
{
133
	static int	lbus,ldev,lfunc,fd = -1,is_write = 0;
142
	static int	ldomain, lbus,ldev,lfunc,fd = -1,is_write = 0;
134
	int		bus, dev, func;
143
	int		domain, bus, dev, func;
135
	char		file[32];
144
	char		file[32];
136
	struct stat	ignored;
145
	struct stat	ignored;
137
146
138
	bus  = PCI_BUS_FROM_TAG(tag);
147
	domain = PCI_DOM_FROM_TAG(tag);
148
	bus  = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(tag));
139
	dev  = PCI_DEV_FROM_TAG(tag);
149
	dev  = PCI_DEV_FROM_TAG(tag);
140
	func = PCI_FUNC_FROM_TAG(tag);
150
	func = PCI_FUNC_FROM_TAG(tag);
141
	if (fd == -1 || (write && (!is_write))
151
142
	    || bus != lbus || dev != ldev || func != lfunc) {
152
	if (!domain_support && domain > 0)
143
		if (fd != -1)
153
	    return -1;
154
155
	if (fd == -1 || (write && (!is_write)) || bus != lbus
156
		|| dev != ldev || func != lfunc || domain != ldomain) {
157
158
		if (fd != -1) {
144
			close(fd);
159
			close(fd);
160
			fd = -1;
161
		}
145
		if (bus < 256) {
162
		if (bus < 256) {
146
		        sprintf(file,"/proc/bus/pci/%02x",bus);
163
		        sprintf(file, "/proc/bus/pci/%04x:%02x", domain, bus);
147
			if (stat(file, &ignored) < 0)
164
			if (stat(file, &ignored) < 0) {
148
				sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
165
				if (domain == 0) 
149
					bus, dev, func);
166
					sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
150
			else
167
						bus, dev, func);
151
				sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
168
				else goto bail;
152
					bus, dev, func);
169
			} else
170
				sprintf(file, "/proc/bus/pci/%04x:%02x/%02x.%1x",
171
					domain, bus, dev, func);
153
		} else {
172
		} else {
154
		        sprintf(file,"/proc/bus/pci/%04x",bus);
173
		        sprintf(file, "/proc/bus/pci/%04x:%02x", domain, bus);
155
			if (stat(file, &ignored) < 0)
174
			if (stat(file, &ignored) < 0) {
156
				sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x",
175
			    if (domain == 0)
157
					bus, dev, func);
176
					sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
158
			else
177
						bus, dev, func);
159
				sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
178
			    else goto bail;
160
					bus, dev, func);
179
			} else
180
				sprintf(file, "/proc/bus/pci/%04x:%02x/%02x.%1x",
181
					domain, bus, dev, func);
161
		}
182
		}
162
		if (write) {
183
		if (write) {
163
		    fd = open(file,O_RDWR);
184
		    fd = open(file,O_RDWR);
Lines 171-177 Link Here
171
			    fd = open(file,O_RDONLY);
192
			    fd = open(file,O_RDONLY);
172
			    is_write = FALSE;
193
			    is_write = FALSE;
173
		}
194
		}
174
		
195
	bail:
196
		ldomain = domain;
175
		lbus  = bus;
197
		lbus  = bus;
176
		ldev  = dev;
198
		ldev  = dev;
177
		lfunc = func;
199
		lfunc = func;
Lines 482-487 Link Here
482
    }
504
    }
483
}
505
}
484
506
507
static Bool
508
linuxDomainSupport(void)
509
{
510
    DIR *dir;
511
    struct dirent *dirent;
512
    char *end;
513
514
    if (!(dir = opendir("/proc/bus/pci")))
515
	return FALSE;
516
    while (1) {
517
	if (!(dirent = readdir(dir)))
518
	    return FALSE;
519
	strtol(dirent->d_name,&end,16);
520
	/* entry of the form xx or xxxx : x=[0..f] no domain */
521
	if (*end == '\0')
522
	    return FALSE;
523
	else if (*end == ':') {
524
	    /* ':' found immediately after: verify for xxxx:xx or xxxx:xxxx */
525
	    strtol(end + 1,&end,16);
526
	    if (*end == '\0')
527
		return TRUE;
528
	}
529
    }
530
    return FALSE;
531
} 
532
	
485
int
533
int
486
xf86GetPciDomain(PCITAG Tag)
534
xf86GetPciDomain(PCITAG Tag)
487
{
535
{
Lines 724-730 Link Here
724
    struct stat st;
772
    struct stat st;
725
773
726
    dom  = PCI_DOM_FROM_TAG(Tag);
774
    dom  = PCI_DOM_FROM_TAG(Tag);
727
    bus  = PCI_BUS_FROM_TAG(Tag);
775
    bus  = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(Tag));
728
    dev  = PCI_DEV_FROM_TAG(Tag);
776
    dev  = PCI_DEV_FROM_TAG(Tag);
729
    func = PCI_FUNC_FROM_TAG(Tag);
777
    func = PCI_FUNC_FROM_TAG(Tag);
730
    sprintf(file, "/sys/devices/pci%04x:%02x/%04x:%02x:%02x.%1x/rom",
778
    sprintf(file, "/sys/devices/pci%04x:%02x/%04x:%02x:%02x.%1x/rom",
Lines 892-894 Link Here
892
}
940
}
893
941
894
#endif /* !INCLUDE_XF86_NO_DOMAIN */
942
#endif /* !INCLUDE_XF86_NO_DOMAIN */
943
944
#ifdef __ia64__
945
static PCITAG ia64linuxPciFindFirst(void);
946
static PCITAG ia64linuxPciFindNext(void);
947
948
void
949
ia64linuxPciInit()
950
{
951
    struct stat st;
952
953
    linuxPciInit();
954
955
    if (!stat("/proc/sgi_sn/licenseID", &st) && pciNumBuses) {
956
	/* Be a little paranoid here and only use this code for Altix systems.
957
	 * It is generic, so it should work on any system, but depends on
958
	 * /proc/bus/pci entries for each domain/bus combination. Altix is
959
	 * guaranteed a recent enough kernel to have them.
960
	 */
961
	pciFindFirstFP = ia64linuxPciFindFirst;
962
	pciFindNextFP  = ia64linuxPciFindNext;
963
    }
964
}
965
966
static DIR *busdomdir;
967
static DIR *devdir;
968
969
static PCITAG
970
ia64linuxPciFindFirst(void)
971
{
972
	busdomdir = opendir("/proc/bus/pci");
973
	devdir = NULL;
974
975
	return ia64linuxPciFindNext();
976
}
977
978
static struct dirent *getnextbus(int *domain, int *bus)
979
{
980
    struct dirent *entry;
981
    int dombus;
982
983
    for (;;) {
984
        entry = readdir(busdomdir);
985
        if (entry == NULL) {
986
            *domain = 0;
987
            *bus = 0;
988
            closedir(busdomdir);
989
            return NULL;
990
        }
991
        if (sscanf(entry->d_name, "%04x:%02x", domain, bus) != 2)
992
            continue;
993
        dombus = PCI_MAKE_BUS(*domain, *bus);
994
995
        if (pciNumBuses <= dombus)
996
            pciNumBuses = dombus + 1;
997
        if (!pciBusInfo[dombus]) {
998
            pciBusInfo[dombus] = xnfalloc(sizeof(pciBusInfo_t));
999
            *pciBusInfo[dombus] = *pciBusInfo[0];
1000
        }
1001
1002
        return entry;
1003
    }
1004
}
1005
1006
static PCITAG
1007
ia64linuxPciFindNext(void)
1008
{
1009
    struct dirent *entry;
1010
    char file[40];
1011
    static int bus, dev, func, domain;
1012
    PCITAG pciDeviceTag;
1013
    CARD32 devid;
1014
1015
    for (;;) {
1016
        if (devdir == NULL) {
1017
            entry = getnextbus(&domain, &bus);
1018
            if (!entry)
1019
                return PCI_NOT_FOUND;
1020
            snprintf(file, 40, "/proc/bus/pci/%s", entry->d_name);
1021
            devdir = opendir(file);
1022
            if (!devdir)
1023
                return PCI_NOT_FOUND;
1024
1025
        }
1026
1027
        entry = readdir(devdir);
1028
1029
        if (entry == NULL) {
1030
            closedir(devdir);
1031
            devdir = NULL;
1032
            continue;
1033
        }
1034
1035
        if (sscanf(entry->d_name, "%02x . %01x", &dev, &func) == 2) {
1036
            pciDeviceTag = PCI_MAKE_TAG(PCI_MAKE_BUS(domain, bus), dev, func);
1037
            devid = pciReadLong(pciDeviceTag, PCI_ID_REG);
1038
            if ((devid & pciDevidMask) == pciDevid)
1039
                /* Yes - Return it.  Otherwise, next device */
1040
                return pciDeviceTag;
1041
        }
1042
    }
1043
}
1044
#endif
(-)programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h (+2 lines)
Lines 768-773 Link Here
768
ADDRESS	      pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
768
ADDRESS	      pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
769
ADDRESS	      pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
769
ADDRESS	      pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
770
PCITAG	      pciTag(int busnum, int devnum, int funcnum);
770
PCITAG	      pciTag(int busnum, int devnum, int funcnum);
771
void	      pciInfoFromTag(PCITAG tag, int *domainnum,
772
				int *busnum, int *devnum, int *funcnum);
771
int	      pciGetBaseSize(PCITAG tag, int indx, Bool destructive, Bool *min);
773
int	      pciGetBaseSize(PCITAG tag, int indx, Bool destructive, Bool *min);
772
CARD32	      pciCheckForBrokenBase(PCITAG tag,int basereg);
774
CARD32	      pciCheckForBrokenBase(PCITAG tag,int basereg);
773
pointer	      xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag,
775
pointer	      xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag,
(-)programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c (-4 / +77 lines)
Lines 28-43 Link Here
28
Bool
28
Bool
29
xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
29
xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
30
{
30
{
31
    FILE *file;
31
    char c[0x200];
32
    char c[0x200];
32
    char *res;
33
    char *res;
33
    unsigned int bus, devfn, dev, fn;
34
    unsigned int domain, bus, devfn, dev, fn;
34
    unsigned PCIADDR_TYPE size[7];
35
    unsigned PCIADDR_TYPE size[7];
35
    unsigned int num;
36
    unsigned int num;
36
    signed PCIADDR_TYPE Size;
37
    signed PCIADDR_TYPE Size;
38
    int resource;
39
    unsigned PCIADDR_TYPE begin, end;
37
40
38
    if (index > 7)
41
    if (index > 7)
39
	return FALSE;
42
	return FALSE;
40
    
43
44
    pciInfoFromTag(tag, &domain, &bus, &dev, &fn);
45
46
    sprintf(c, "/sys/devices/pci%04x:%02x/%04x:%02x:%02x.%1x/resource",
47
	    domain, bus, domain, bus, dev, fn);
48
    if (file = fopen(c, "r")) {
49
        for (resource=0; resource != index; resource++)
50
            fgets(c, 0x1ff, file);
51
        res = fgets(c, 0x1ff, file);
52
        num = sscanf(res, PCIADDR_FMT " " PCIADDR_FMT " " PCIADDR_IGNORE_FMT,
53
                     &begin, &end);
54
        if (num == 2) {
55
            Size = end - begin;
56
		    while (Size & ((PCIADDR_TYPE) 0x01)) {
57
                Size = Size >> ((PCIADDR_TYPE) 1);
58
                (*bits)++;
59
            }
60
            fclose(file);
61
            return TRUE;
62
        }
63
        fclose(file);
64
    }
65
41
    if (!xf86OSLinuxPCIFile && \
66
    if (!xf86OSLinuxPCIFile && \
42
        !(xf86OSLinuxPCIFile = fopen("/proc/bus/pci/devices","r")))
67
        !(xf86OSLinuxPCIFile = fopen("/proc/bus/pci/devices","r")))
43
	return FALSE;
68
	return FALSE;
Lines 99-111 Link Here
99
    FILE *file;
124
    FILE *file;
100
    char c[0x200];
125
    char c[0x200];
101
    char *res;
126
    char *res;
102
    unsigned int bus, devfn, dev, fn;
127
    unsigned int domain, bus, devfn, dev, fn;
103
    unsigned PCIADDR_TYPE offset[7];
128
    unsigned PCIADDR_TYPE offset[7];
104
    unsigned int num;
129
    unsigned int num;
130
    int resource;
105
131
106
    if (index > 7)
132
    if (index > 7)
107
        return FALSE;
133
        return FALSE;
108
134
135
    pciInfoFromTag(tag, &domain, &bus, &dev, &fn);
136
137
    sprintf(c, "/sys/devices/pci%04x:%02x/%04x:%02x:%02x.%1x/resource",
138
	    domain, bus, domain, bus, dev, fn);
139
    if (file = fopen(c, "r")) {
140
        for (resource=0; resource != index; resource++)
141
            fgets(c, 0x1ff, file);
142
        res = fgets(c, 0x1ff, file);
143
        num = sscanf(res, PCIADDR_FMT " " PCIADDR_IGNORE_FMT " " PCIADDR_IGNORE_FMT,
144
                     &offset[0]);
145
        if (num == 1) {
146
            *bases = offset[0];
147
            fclose(file);
148
            return TRUE;
149
        }
150
        fclose(file);
151
    }
152
109
    if (!(file = fopen("/proc/bus/pci/devices","r")))
153
    if (!(file = fopen("/proc/bus/pci/devices","r")))
110
        return FALSE;
154
        return FALSE;
111
    do {
155
    do {
Lines 159-169 Link Here
159
    FILE *file;
203
    FILE *file;
160
    char c[0x200];
204
    char c[0x200];
161
    char *res;
205
    char *res;
162
    unsigned int bus, devfn, dev, fn;
206
    unsigned int domain, bus, devfn, dev, fn;
163
    unsigned PCIADDR_TYPE offset[7];
207
    unsigned PCIADDR_TYPE offset[7];
164
    unsigned PCIADDR_TYPE size[7];
208
    unsigned PCIADDR_TYPE size[7];
165
    unsigned int num;
209
    unsigned int num;
166
    unsigned int ndx;
210
    unsigned int ndx;
211
    unsigned PCIADDR_TYPE begin,end;
212
213
    pciInfoFromTag(tag, &domain, &bus, &dev, &fn);
214
215
    sprintf(c, "/sys/devices/pci%04x:%02x/%04x:%02x:%02x.%1x/resource",
216
	    domain, bus, domain, bus, dev, fn);
217
    if (file = fopen(c, "r")) {
218
        unsigned long savePtr;
219
        for (ndx=0; ndx < 7; ndx++) {
220
            res = fgets(c, 0x1ff, file);
221
            if (!res)
222
                break;
223
            num = sscanf(res, PCIADDR_FMT " " PCIADDR_FMT " " PCIADDR_IGNORE_FMT,
224
                         &begin, &end);
225
            if (num == 2) {
226
                if (ndx == 6)
227
                    savePtr = (0xFFFFFFF0) &
228
                        pciReadLong(tag, PCI_CMD_BIOS_REG);
229
                else /* this the ROM bar */
230
                    savePtr = (0xFFFFFFF0) &
231
                        pciReadLong(tag, PCI_CMD_BASE_REG + (0x4 * ndx));
232
                if (base >= savePtr && base <= (savePtr + (end - begin))) {
233
                    fclose(file);
234
                    return ( ~(0xFUL) & (begin + (base - savePtr)));
235
                }
236
            }
237
        }
238
        fclose(file);
239
    }
167
240
168
    if (!(file = fopen("/proc/bus/pci/devices","r")))
241
    if (!(file = fopen("/proc/bus/pci/devices","r")))
169
        return 0;
242
        return 0;

Return to bug 132308