]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Arch-abstraction:
authorNicholas Nethercote <n.nethercote@gmail.com>
Wed, 20 Oct 2004 13:21:54 +0000 (13:21 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Wed, 20 Oct 2004 13:21:54 +0000 (13:21 +0000)
- conditionally compile x86-specific line within yield.c.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2821

none/tests/Makefile.am
none/tests/yield.c

index 797032d5698cffdd0cf13c419e012a939347fbaf..e3ee379531043734dcb77f8271eaf648ad21dba7 100644 (file)
@@ -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
index 45694d8d94faaa5b4dd18d4f846aa84337f8c367..11ec724ea41645888a5662e92450390332f882ec 100644 (file)
@@ -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;