42 lines
2.4 KiB
Plaintext
42 lines
2.4 KiB
Plaintext
$OpenBSD: patch-ev_c,v 1.4 2012/12/28 18:27:23 dcoppa Exp $
|
|
|
|
Add support for OpenBSD/alpha and OpenBSD/mips64 (latter from ev.c -r1.412).
|
|
|
|
Add support for OpenBSD/hppa
|
|
|
|
--- ev.c.orig Sat Feb 4 20:09:52 2012
|
|
+++ ev.c Fri Dec 28 19:16:35 2012
|
|
@@ -559,12 +559,12 @@ struct signalfd_siginfo
|
|
#if ECB_GCC_VERSION(2,5) || defined(__INTEL_COMPILER) || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
|
|
#if __i386 || __i386__
|
|
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory")
|
|
- #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */
|
|
- #define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */
|
|
+ #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("" : : : "memory")
|
|
+ #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
|
|
#elif __amd64 || __amd64__ || __x86_64 || __x86_64__
|
|
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mfence" : : : "memory")
|
|
- #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("lfence" : : : "memory")
|
|
- #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("sfence") /* play safe - not needed in any current cpu */
|
|
+ #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("" : : : "memory")
|
|
+ #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
|
|
#elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
|
|
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
|
|
#elif defined(__ARM_ARCH_6__ ) || defined(__ARM_ARCH_6J__ ) \
|
|
@@ -579,6 +579,15 @@ struct signalfd_siginfo
|
|
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
|
|
#elif defined(__s390__) || defined(__s390x__)
|
|
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory")
|
|
+ #elif defined(__mips__)
|
|
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
|
|
+ #elif defined(__alpha__)
|
|
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mb" : : : "memory")
|
|
+ #elif defined(__hppa__)
|
|
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory")
|
|
+ #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
|
|
+ #elif defined(__ia64__)
|
|
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mf" : : : "memory")
|
|
#endif
|
|
#endif
|
|
#endif
|