summaryrefslogtreecommitdiffstats
path: root/tools/virtio
diff options
context:
space:
mode:
Diffstat (limited to 'tools/virtio')
-rw-r--r--tools/virtio/ringtest/main.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h
index 90b0133004e1..5706e075adf2 100644
--- a/tools/virtio/ringtest/main.h
+++ b/tools/virtio/ringtest/main.h
@@ -110,11 +110,15 @@ static inline void busy_wait(void)
110 barrier(); 110 barrier();
111} 111}
112 112
113#if defined(__x86_64__) || defined(__i386__)
114#define smp_mb() asm volatile("lock; addl $0,-128(%%rsp)" ::: "memory", "cc")
115#else
113/* 116/*
114 * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized 117 * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized
115 * with other __ATOMIC_SEQ_CST calls. 118 * with other __ATOMIC_SEQ_CST calls.
116 */ 119 */
117#define smp_mb() __sync_synchronize() 120#define smp_mb() __sync_synchronize()
121#endif
118 122
119/* 123/*
120 * This abuses the atomic builtins for thread fences, and 124 * This abuses the atomic builtins for thread fences, and