[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: No valid MMIO address in PCI config space



> I'll investigate this tomorrow.

Well, here is a fix. Problem was that on alpha lines in
/proc/bus/pci/devices are quite a bit longer (format for "long"
is "%16lx" vs. "%08lx" on 32-bit platforms), so they don't fit
in the fgets() buffer. Apparently lnx_pci.c was written and
tested on some 32-bit system. ;-)
With this patch all that "resource overlap" weirdness is gone.

Ivan.

--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c.orig	Tue Oct 17 20:53:20 2000
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c	Fri Mar  2 13:23:04 2001
@@ -13,7 +13,7 @@ Bool
 xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
 {
     FILE *file;
-    char c[0x100];
+    char c[0x200];
     char *res;
     int bus, devfn, dev, fn;
     unsigned int size[7];
@@ -26,7 +26,7 @@ xf86GetPciSizeFromOS(PCITAG tag, int ind
     if (!(file = fopen("/proc/bus/pci/devices","r")))
 	return FALSE;
     do {
-	res = fgets(c,0xff,file);
+	res = fgets(c,0x1ff,file);
 	if (res) {
 	    num = sscanf(res,"%02x%02x\t%*04x%*04x\t%*x"
 			     "\t%*x\t%*x\t%*x\t%*x\t%*x\t%*x\t%*x"





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []