[PATCH] Work around ARM define/undef hackery to allow sys.c to compile

Matt Turner mattst88 at gmail.com
Sun Nov 8 19:52:38 PST 2009


The '#define outb xf_outb' stuff breaks sys.c compilation. Let's just
put in this hack until we get PCI in/out sorted out for good.

Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
 hw/xfree86/common/compiler.h |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index dc5f157..a1871a0 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -980,29 +980,48 @@ inl(unsigned short port)
 /* note that the appropriate setup via "ioperm" needs to be done */
 /*  *before* any inx/outx is done. */
 
-#include <sys/io.h>
+extern _X_EXPORT void _outb(unsigned char val, unsigned long port);
+extern _X_EXPORT void _outw(unsigned short val, unsigned long port);
+extern _X_EXPORT void _outl(unsigned int val, unsigned long port);
+extern _X_EXPORT unsigned int _inb(unsigned long port);
+extern _X_EXPORT unsigned int _inw(unsigned long port);
+extern _X_EXPORT unsigned int _inl(unsigned long port);
 
 static __inline__ void
-xf_outb(unsigned short port, unsigned char val)
+outb(unsigned long port, unsigned char val)
 {
-    outb(val, port);
+    _outb(val, port);
 }
 
 static __inline__ void
-xf_outw(unsigned short port, unsigned short val)
+outw(unsigned long port, unsigned short val)
 {
-    outw(val, port);
+    _outw(val, port);
 }
 
 static __inline__ void
-xf_outl(unsigned short port, unsigned int val)
+outl(unsigned long port, unsigned int val)
 {
-    outl(val, port);
+    _outl(val, port);
 }
 
-#define outb xf_outb
-#define outw xf_outw
-#define outl xf_outl
+static __inline__ unsigned int
+inb(unsigned long port)
+{
+  return _inb(port);
+}
+
+static __inline__ unsigned int
+inw(unsigned long port)
+{
+  return _inw(port);
+}
+
+static __inline__ unsigned int
+inl(unsigned long port)
+{
+  return _inl(port);
+}
 
 #   else /* ix86 */
 
-- 
1.6.4.4



More information about the xorg-devel mailing list