Hello,

Yes, we could use __sync_synchronize() an non x86 archs.

It is also needed to define rte_pause.

The patch that solves this issue for me is attached.

I had tested it on mips, mipsel and amd64.



Could you please consider including this patch.


Regards,
Dejan
diff -uNr masscan-1.0.3-90-g2441f18~ds0.orig/src/pixie-threads.h masscan-1.0.3-90-g2441f18~ds0/src/pixie-threads.h
--- masscan-1.0.3-90-g2441f18~ds0.orig/src/pixie-threads.h	2014-10-15 13:05:50.000000000 +0000
+++ masscan-1.0.3-90-g2441f18~ds0/src/pixie-threads.h	2015-02-05 11:28:39.000000000 +0000
@@ -40,10 +40,10 @@
 #define pixie_locked_CAS32(dst, src, expected) __sync_bool_compare_and_swap((volatile int*)(dst),(int)expected,(int)src);
 #define pixie_locked_CAS64(dst, src, expected) __sync_bool_compare_and_swap((volatile long long int*)(dst),(long long int)expected,(long long int)src);
 
-#if defined(__arm__)
+#if !defined(__x86_64__) && !defined(__i386__)
 #define rte_wmb() __sync_synchronize()
 #define rte_rmb() __sync_synchronize()
-#define rte_pause()
+#define rte_pause() asm volatile( "" : : : "memory")
 #else
 #define rte_wmb() asm volatile("sfence;" : : : "memory")
 #define rte_rmb() asm volatile("lfence;" : : : "memory")

Reply via email to