|
From: <sv...@va...> - 2006-10-17 01:49:54
|
Author: sewardj
Date: 2006-10-17 02:49:50 +0100 (Tue, 17 Oct 2006)
New Revision: 6279
Log:
Merge r6143: Deal with ppc{32,64}-aix5.
Modified:
trunk/tests/cputest.c
Modified: trunk/tests/cputest.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tests/cputest.c 2006-10-17 01:48:41 UTC (rev 6278)
+++ trunk/tests/cputest.c 2006-10-17 01:49:50 UTC (rev 6279)
@@ -23,7 +23,7 @@
NULL
};
=20
-#if defined(__powerpc__) && !defined(__powerpc64__)
+#if !defined(_AIX) && defined(__powerpc__) && !defined(__powerpc64__)
static Bool go(char* cpu)
{
if ( strcmp( cpu, "ppc32" ) =3D=3D 0 )
@@ -32,7 +32,7 @@
}
#endif // __powerpc__ (32)
=20
-#if defined(__powerpc__) && defined(__powerpc64__)
+#if !defined(_AIX) && defined(__powerpc__) && defined(__powerpc64__)
static Bool go(char* cpu)
{
if ( strcmp( cpu, "ppc64" ) =3D=3D 0 )
@@ -43,7 +43,24 @@
}
#endif // __powerpc__ (64)
=20
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(_AIX)
+static Bool go(char* cpu)
+{
+ if (sizeof(void*) =3D=3D 8) {
+ /* cpu is in 64-bit mode */
+ if ( strcmp( cpu, "ppc64" ) =3D=3D 0 )
+ return True;
+ if ( strcmp( cpu, "ppc32" ) =3D=3D 0 )
+ return True;
+ } else {
+ if ( strcmp( cpu, "ppc32" ) =3D=3D 0 )
+ return True;
+ }
+ return False;
+}
+#endif // _AIX
+
+#if !defined(_AIX) && (defined(__i386__) || defined(__x86_64__))
static void cpuid ( unsigned int n,
unsigned int* a, unsigned int* b,
unsigned int* c, unsigned int* d )
@@ -106,7 +123,7 @@
}
return False;
}
-#endif // __i386__ || __x86_64__
+#endif // !_AIX && (__i386__ || __x86_64__)
=20
=20
int main(int argc, char **argv)
|