Subject: XFree86 changes 4.7.99.2 to compile.
To: None <port-alpha@netbsd.org>
From: mel kravitz <melk@switchpwr.com>
List: port-alpha
Date: 10/04/2007 07:55:27
Changes made to compile 4.2, 4.3, 4.4 or 4.5 
(xc/programs..../os-support/bsd/alpha_video.c)and roll back 
xc/programs..../os-support/bus/netbsdPci.c to v 1.9 to v 1.5 (diff)
I also modified /usr/include/sys/types.h to add and wrap  #typedef 
int64_t and #ifndef key_t in #endif:

typedef        int64_t         daddr_t;        /* disk address */
#endif
+#ifndef dev_t
typedef        uint32_t        dev_t;          /* device number */
+#endif
+
typedef        uint32_t        fixpt_t;        /* fixed point number */
#ifndef        gid_t
@@ -163,7 +166,10 @@
typedef        uint32_t        id_t;           /* group id, process  id 
or user id */
typedef        uint64_t        ino_t;          /* inode number */
+
+#ifndef key_t
typedef        long            key_t;          /* IPC key (for Sys V  
IPC) */
+#endif
#ifndef        mode_t
typedef        __mode_t        mode_t;         /* permissions */

added xc/config/cf/host.def file:

#define HasPerl YES    /* optional, from pkgsrc; for some fonts */
#define DefaultGcc2AxpOpt -O2 -mcpu=ev56 -Wa,-m21164a  /* modify to  
match your CPU */
#define BuildXF86DRI NO    /* :(   */
#define BuildXF86DRIDriverSupport NO
#define XF86CardDrivers mga ati tga glint nv s3 s3virge vga /* modify to 
match  your card(s) */
#define DoLoadableServer NO -------------------------------------
Mel



------------------------------------------------------------------------

1c1
< /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.5 2004/02/13 23:58:47 dawes Exp $ */
---

> > /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.9 2007/07/10 17:15:54 tsi Exp $ */
>   
91a92,95

> > 	/* Always prefer a hardware-derived mechanism over an OS-provided one */
> > 	if (pciNumBuses)
> > 		return;
> > 
>   
93,94c97,118
< 	if (devpci == -1)
< 		FatalError("netbsdPciInit: can't open /dev/pci0\n");
---

> > 	if (devpci < 0) {
> > 		if (errno != EPERM)
> > 			return;
> > 
> > 		/* Try again without write access */
> > 		devpci = open("/dev/pci0", O_RDONLY);
> > 		if (devpci < 0)
> > 			return;
> > 
> > 		xf86MsgVerb(X_WARNING, 3,
> > 			"OS limits PCI configuration space access to"
> > 			" read-only\n");
> > 	}
> > 
> > 	/* Use businfo to get the number of devs */
> > 	if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0) {
> > 	    ErrorF("netbsdPciInit: /dev/pci0 not a PCI bus device (%s)",
> > 		strerror(errno));
> > 	    close(devpci);
> > 	    devpci = -1;
> > 	    return;
> > 	}
>   
100,102d123
< 	/* use businfo to get the number of devs */
< 	if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0)
< 	    FatalError("netbsdPciInit: not a PCI bus device");
116,118c137,143
< 	if (ioctl(devpci, PCI_IOC_BDF_CFGREAD, &bdfr) == -1)
< 		FatalError("netbsdPciConfRead: failed on %d/%d/%d\n",
< 		    bdfr.bus, bdfr.device, bdfr.function);
---

> > 	if (ioctl(devpci, PCI_IOC_BDF_CFGREAD, &bdfr) == -1) {
> > 		xf86MsgVerb(X_WARNING, 4,
> > 		    "netbsdPciConfRead: failed on %d:%d:%d %02x (%s)\n",
> > 		    bdfr.bus, bdfr.device, bdfr.function, reg,
> > 		    strerror(errno));
> > 		return ~0;
> > 	}
>   
135,136c160,163
< 		FatalError("netbsdPciConfWrite: failed on %d/%d/%d\n",
< 		    bdfr.bus, bdfr.device, bdfr.function);
---

> > 		xf86MsgVerb(X_WARNING, 4,
> > 		    "netbsdPciConfWrite: failed on %d:%d:%d %02x %08lx (%s)\n",
> > 		    bdfr.bus, bdfr.device, bdfr.function, reg,
> > 		    (unsigned long)val, strerror(errno));
>