|
From: <sv...@va...> - 2009-05-18 05:45:47
|
Author: njn
Date: 2009-05-18 06:45:42 +0100 (Mon, 18 May 2009)
New Revision: 9897
Log:
Use -mdynamic-no-pic for x86_amd64_features. With that, the x86-darwin
version doesn't need special treatment.
Modified:
branches/DARWIN/tests/Makefile.am
branches/DARWIN/tests/x86_amd64_features.c
Modified: branches/DARWIN/tests/Makefile.am
===================================================================
--- branches/DARWIN/tests/Makefile.am 2009-05-18 05:36:22 UTC (rev 9896)
+++ branches/DARWIN/tests/Makefile.am 2009-05-18 05:45:42 UTC (rev 9897)
@@ -27,3 +27,7 @@
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
+if VGCONF_OS_IS_DARWIN
+x86_amd64_features_CFLAGS = $(AM_CFLAGS) -mdynamic-no-pic
+endif
+
Modified: branches/DARWIN/tests/x86_amd64_features.c
===================================================================
--- branches/DARWIN/tests/x86_amd64_features.c 2009-05-18 05:36:22 UTC (rev 9896)
+++ branches/DARWIN/tests/x86_amd64_features.c 2009-05-18 05:45:42 UTC (rev 9897)
@@ -17,11 +17,8 @@
#define True 1
typedef int Bool;
-//---------------------------------------------------------------------------
-// {x86,amd64}-linux (part 1 of 2)
-//---------------------------------------------------------------------------
-#if defined(VGP_x86_linux) || defined(VGP_amd64_linux) || \
- defined(VGP_amd64_darwin)
+
+#if defined(VGA_x86) || defined(VGA_amd64)
static void cpuid ( unsigned int n,
unsigned int* a, unsigned int* b,
unsigned int* c, unsigned int* d )
@@ -32,49 +29,6 @@
: "0" (n) /* input */
);
}
-#endif // VGP_x86_linux || VGP_amd64_linux || VGP_amd64_darwin
-
-//---------------------------------------------------------------------------
-// x86-darwin (part 1 of 2)
-//---------------------------------------------------------------------------
-// We can't use the one above for x86-darwin, because we get this:
-//
-// arch_test.c:88: error: can't find a register in class ‘BREG’ while
-// reloading ‘asm’
-//
-// because %ebx is reserved for PIC. This version preserves %ebx.
-#if defined(VGP_x86_darwin)
-static void cpuid ( unsigned int n,
- unsigned int* a, unsigned int* b,
- unsigned int* c, unsigned int* d )
-{
- unsigned int abcd[4] = { n, 0, 0, 0 };
-
- __asm__ __volatile__ (
- "\tmovl %%ebx,%%esi\n"
- "\tmovl 0(%0),%%eax\n"
- "\tcpuid\n"
- "\tmovl %%eax,0(%0)\n"
- "\tmovl %%ebx,4(%0)\n"
- "\tmovl %%ecx,8(%0)\n"
- "\tmovl %%edx,12(%0)\n"
- "\tmovl %%esi,%%ebx\n"
- : /*out*/
- : /*in*/ "r"(abcd)
- : /*clobber*/ "eax", "esi", "ecx", "edx", "memory", "cc"
- );
-
- *a = abcd[0];
- *b = abcd[1];
- *c = abcd[2];
- *d = abcd[3];
-}
-#endif // VGP_x86_darwin
-
-//---------------------------------------------------------------------------
-// {x86,amd64}-{linux,darwin} (part 2 of 2)
-//---------------------------------------------------------------------------
-#if defined(VGA_x86) || defined(VGA_amd64)
static Bool go(char* cpu)
{
unsigned int level = 0, cmask = 0, dmask = 0, a, b, c, d;
|