[Xorg-driver-geode] [PATCH] Allow compilation under 64 bit systems
Huang, FrankR
FrankR.Huang at amd.com
Tue Jun 22 23:35:58 PDT 2010
Gaetan,
Is that to say this solve method will let the geode compilation successful, but in un-use status? Only for the whole build success of the X.org tree?
Thanks,
Frank
-----Original Message-----
From: xorg-driver-geode-bounces+frankr.huang=amd.com at lists.x.org [mailto:xorg-driver-geode-bounces+frankr.huang=amd.com at lists.x.org] On Behalf Of Gaetan Nadon
Sent: 2010?6?23? 7:53
To: xorg-driver-geode at lists.x.org
Subject: [Xorg-driver-geode] [PATCH] Allow compilation under 64 bit systems
Only a few assembler related statements fails to compile
on x86_64. These will be compiled under i386+
Although the driver does not run on 64 bit systems. it prevents
build errors to be reported and it allows non-geode specific
contributions to be made.
Compiled on AMD64
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
src/cim/cim_defs.h | 5 ++++-
src/durango.c | 4 ++++
src/lx_driver.c | 4 ++++
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/cim/cim_defs.h b/src/cim/cim_defs.h
index eea2f49..5d7e257 100644
--- a/src/cim/cim_defs.h
+++ b/src/cim/cim_defs.h
@@ -674,7 +674,9 @@ void cim_outd(unsigned short port, unsigned long data);
void
cim_outd(unsigned short port, unsigned long data)
{
+#ifdef __i386__
__asm__ __volatile__("outl %0,%w1"::"a"(data), "Nd"(port));
+#endif
}
/*-------------------------------------------
@@ -688,8 +690,9 @@ unsigned long
cim_ind(unsigned short port)
{
unsigned long value;
+#ifdef __i386__
__asm__ __volatile__("inl %w1,%0":"=a"(value):"Nd"(port));
-
+#endif
return value;
}
diff --git a/src/durango.c b/src/durango.c
index 9d6970b..20a25a3 100644
--- a/src/durango.c
+++ b/src/durango.c
@@ -200,7 +200,9 @@ gfx_msr_asm_write(unsigned short reg, unsigned long addr,
}
/* This is the fallback VSA method - not preferred */
+#ifdef __i386__
vsa_msr_write(reg, addr, hi, lo);
+#endif
}
void
@@ -218,7 +220,9 @@ gfx_msr_asm_read(unsigned short reg, unsigned long addr,
}
/* This is the fallback VSA method - not preferred */
+#ifdef __i386__
vsa_msr_read(reg, addr, hi, lo);
+#endif
}
#include "gfx_init.c"
diff --git a/src/lx_driver.c b/src/lx_driver.c
index 08d1fdd..71fc958 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -125,7 +125,9 @@ LXReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi)
if (GeodeReadMSR(addr, lo, hi) == -1) {
unsigned int l, h;
+#ifdef __i386__
LX_MSR_READ(addr, l, h);
+#endif
*lo = l;
*hi = h;
}
@@ -134,8 +136,10 @@ LXReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi)
static void
LXWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi)
{
+#ifdef __i386__
if (GeodeWriteMSR(addr, lo, hi) == -1)
LX_MSR_WRITE(addr, lo, hi);
+#endif
}
static unsigned int
--
1.6.0.4
This is my preferred solution. Most drivers compile on all platforms
even if runnable on some.
Compiled on Intel 32 and AMD64. Please check that __i386__ is defined
on all platforms that Geode is expected to run under.
_______________________________________________
Xorg-driver-geode mailing list
Xorg-driver-geode at lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-geode
More information about the Xorg-driver-geode
mailing list