Subject: Re: need tester for cross-built xf4 Xhpc (hpcarm) Xserver
To: None <takemura@ca2.so-net.ne.jp>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: tech-x11
Date: 12/30/2003 09:10:28
In article <20031230.174131.68544461.takemura@ca2.so-net.ne.jp>
takemura@ca2.so-net.ne.jp wrote:

> I'm also working on Xhpc for hpcmips. But it still have too many MIPS
> dependent problem to compile.

Around ldq_u() and stq_u() etc? How about the attached patch?

The problem currently I have on Xdreamcast is dreamcast16ScreenInit()
function (maybe mostli identical with hpc*ScreenInit()).
At least, it seems API of miScreenInit was changed.

Maybe it's easier and better to change these initializations
like what Xmacppc/Xsun does (which call cfbScreenInit(),
not miScreenInit()), but I'm not sure.
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp

Index: cfb/cfbmskbits.h
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/cfb/cfbmskbits.h,v
retrieving revision 1.2
diff -u -r1.2 cfbmskbits.h
--- cfb/cfbmskbits.h	23 Dec 2003 04:33:27 -0000	1.2
+++ cfb/cfbmskbits.h	29 Dec 2003 23:54:29 -0000
@@ -41,6 +41,21 @@
 #endif
 
 /*
+ * XXX ldq_u() is used below unconditionally, but only pulled in if
+ * XXX XFREE86 is defined (above).  I suspect someone didn't think
+ * XXX about the possibility of using this code on an Alpha running
+ * XXX something other than Linux.
+ */
+#if defined(__NetBSD__) && \
+    (defined(__alpha__) || \
+     defined(__arm__) || \
+     defined(__mips__) || \
+     defined(__sh__) || \
+     defined(__vax__))
+#include        "../hw/xfree86/common/compiler.h"
+#endif
+
+/*
  * ==========================================================================
  * Converted from mfb to support memory-mapped color framebuffer by smarks@sun, 
  * April-May 1987.
Index: hw/xfree86/common/compiler.h
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/common/compiler.h,v
retrieving revision 1.11
diff -u -r1.11 compiler.h
--- hw/xfree86/common/compiler.h	29 Dec 2003 08:54:48 -0000	1.11
+++ hw/xfree86/common/compiler.h	29 Dec 2003 23:54:30 -0000
@@ -848,12 +848,16 @@
 #    define mem_barrier()         /* XXX: nop for now */
 #    define write_mem_barrier()   /* XXX: nop for now */
 
-#   elif defined(__mips__) || defined(__arm32__) || defined(__arm__)
-#ifdef __arm32__
+#   elif defined(__mips__) || defined(__arm32__) || defined(__arm__) || defined(__sh__)
+#if defined(__NetBSD__)
+#define PORT_SIZE u_int
+#else
+#if defined(__arm32__)
 #define PORT_SIZE long
 #else
 #define PORT_SIZE short
 #endif
+#endif
 
 unsigned int IOPortBase;  /* Memory mapped I/O port area */
 
@@ -1006,7 +1010,7 @@
 #     endif /* !linux */
 #    endif /* __mips__ */
 
-#    if defined(__arm32__) || defined(__arm__)
+#    if defined(__arm32__) || defined(__arm__) || defined(__sh__)
 #     define ldq_u(p)	(*((unsigned long  *)(p)))
 #     define ldl_u(p)	(*((unsigned int   *)(p)))
 #     define ldw_u(p)	(*((unsigned short *)(p)))
@@ -1015,7 +1019,7 @@
 #     define stw_u(v,p)	(*(unsigned short *)(p)) = (v)
 #     define mem_barrier()	/* NOP */
 #     define write_mem_barrier()	/* NOP */
-#    endif /* __arm32__ || __arm__ */
+#    endif /* __arm32__ || __arm__ || __sh__ */
 
 #   elif (defined(Lynx) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__)) && defined(__powerpc__)