From: Nicholas Nethercote Date: Wed, 20 Oct 2004 13:21:54 +0000 (+0000) Subject: Arch-abstraction: X-Git-Tag: svn/VALGRIND_3_0_0~1474 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb447e7be6c26053984ea12cac93e380aab7239b;p=thirdparty%2Fvalgrind.git Arch-abstraction: - conditionally compile x86-specific line within yield.c. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2821 --- diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 797032d569..e3ee379531 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -107,6 +107,7 @@ system_SOURCES = system.c #tls2_so_SOURCES = tls2_so.c #tls2_so_LDFLAGS = -shared yield_SOURCES = yield.c +yield_CFLAGS = $(AM_CFLAGS) -D__$(VG_ARCH)__ yield_LDADD = -lpthread # pthread C ones diff --git a/none/tests/yield.c b/none/tests/yield.c index 45694d8d94..11ec724ea4 100644 --- a/none/tests/yield.c +++ b/none/tests/yield.c @@ -35,7 +35,11 @@ static void *th2(void *v) while(alive) { rep_nop++; +#ifdef __x86__ + // This gives a hint to a P4, telling it to pause + // (ie. we're in a spin-wait loop) asm volatile ("rep; nop" : : : "memory"); +#endif } return 0;