Subject: xfree patches for -current xsrc.
To: None <port-alpha@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: port-alpha
Date: 03/30/2001 00:14:45
The import of xfree 4.0.3 broke compiling on alpha.  The following
patches at least get things building again, but I wont have a chance
to test them for a little while.  Can someone else give these patches
a test please?

I've put a binary of the Xserver itself (compiled against NetBSD 1.5S)
on ftp://ftp.netbsd.org/pub/NetBSD/misc/simonb/XFree86-alpha-403.gz.
It's not linked against any of the X11 libraries, should you should be
able to run it on an existing xfree 4.0.2 installation.

TIA,
Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD CDs, Support and Service:    http://www.wasabisystems.com/


Index: bsd_axp.c
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c,v
retrieving revision 1.1.1.1
diff -d -p -u -r1.1.1.1 bsd_axp.c
--- bsd_axp.c	2001/03/18 17:33:05	1.1.1.1
+++ bsd_axp.c	2001/03/29 00:41:21
@@ -6,13 +6,15 @@
 #include "xf86Priv.h"
 #include "xf86Axp.h"
 #include "xf86_OSlib.h"
-#include <stdio.h>
-#include <sys/sysctl.h>
 
 axpDevice bsdGetAXP(void);
 
+#ifdef __FreeBSD__
+#include <stdio.h>
+#include <sys/sysctl.h>
+
 /*
- * BSD does a very nice job providing system information to
+ * FreeBSD does a very nice job providing system information to
  * user space programs. Unfortunately it doesn't provide all
  * the information required. Therefore we just obtain the
  * system type and look up the rest from a list we maintain
@@ -55,3 +57,19 @@ bsdGetAXP(void)
 			return axpList[i].type;
 	}
 }	
+#elif defined(__NetBSD__)
+/*
+ * There is no need to frob the HAE at all under NetBSD.  So here, we
+ * just return a systype that doesn't use BXW so that at least the code
+ * in bsd_video.c doesn't break.  The results of any calculations are
+ * passed to a sethae() that does nothing (and may even be optimised
+ * away if the compiler is smart enough).
+ */
+axpDevice
+bsdGetAXP(void)
+{
+	return CIA;
+}
+#else
+# error Unknown BSD system
+#endif
Index: bsd_video.c
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c,v
retrieving revision 1.4
diff -d -p -u -r1.4 bsd_video.c
--- bsd_video.c	2001/03/18 19:59:14	1.4
+++ bsd_video.c	2001/03/29 00:41:23
@@ -128,15 +128,13 @@ struct memAccess ioMemInfo = { CONSOLE_G
 #endif
 
 #ifdef __alpha__
-#ifdef __FreeBSD__
-extern unsigned long dense_base(void);
-
 static int axpSystem = -1;
 static unsigned long hae_thresh;
 static unsigned long hae_mask;
-static unsigned long bus_base;
-static unsigned long sparse_size;
 
+#ifdef __FreeBSD__
+extern unsigned long dense_base(void);
+
 static unsigned long
 memory_base(void)
 {
@@ -374,7 +372,6 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
                 axpSystem = bsdGetAXP(); 
 	    hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
             hae_mask = xf86AXPParams[axpSystem].hae_mask;
-            sparse_size = xf86AXPParams[axpSystem].size;
 	}
 #elif defined(__arm32__)
 	pVidMem->mapMem = armMapVidMem;