ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/ecb.h
(Generate patch)

Comparing libecb/ecb.h (file contents):
Revision 1.68 by sf-exg, Thu Aug 25 16:06:08 2011 UTC vs.
Revision 1.69 by root, Sun Sep 25 21:27:02 2011 UTC

71#if ECB_NO_THREADS || ECB_NO_SMP 71#if ECB_NO_THREADS || ECB_NO_SMP
72 #define ECB_MEMORY_FENCE do { } while (0) 72 #define ECB_MEMORY_FENCE do { } while (0)
73#endif 73#endif
74 74
75#ifndef ECB_MEMORY_FENCE 75#ifndef ECB_MEMORY_FENCE
76 #if ECB_GCC_VERSION(2,5) 76 #if ECB_GCC_VERSION(2,5) || defined(__INTEL_COMPILER) || defined(__clang__)
77 #if __i386__ 77 #if __i386__
78 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory") 78 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory")
79 #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */ 79 #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */
80 #define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */ 80 #define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */
81 #elif __amd64 81 #elif __amd64
93 #endif 93 #endif
94 #endif 94 #endif
95#endif 95#endif
96 96
97#ifndef ECB_MEMORY_FENCE 97#ifndef ECB_MEMORY_FENCE
98 #if ECB_GCC_VERSION(4,4) || defined(__INTEL_COMPILER) 98 #if ECB_GCC_VERSION(4,4) || defined(__INTEL_COMPILER) || defined(__clang__)
99 #define ECB_MEMORY_FENCE __sync_synchronize () 99 #define ECB_MEMORY_FENCE __sync_synchronize ()
100 /*#define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); }) */ 100 /*#define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); }) */
101 /*#define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); }) */ 101 /*#define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); }) */
102 #elif _MSC_VER >= 1400 /* VC++ 2005 */ 102 #elif _MSC_VER >= 1400 /* VC++ 2005 */
103 #pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier) 103 #pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines