|
From: Nicholas N. <nj...@ca...> - 2004-10-20 13:22:01
|
CVS commit by nethercote:
Arch-abstraction:
- conditionally compile x86-specific line within yield.c.
M +1 -0 Makefile.am 1.47
M +4 -0 yield.c 1.2
--- valgrind/none/tests/Makefile.am #1.46:1.47
@@ -108,4 +108,5 @@
#tls2_so_LDFLAGS = -shared
yield_SOURCES = yield.c
+yield_CFLAGS = $(AM_CFLAGS) -D__$(VG_ARCH)__
yield_LDADD = -lpthread
--- valgrind/none/tests/yield.c #1.1:1.2
@@ -36,5 +36,9 @@ 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
}
|