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

Comparing libecb/ecb.h (file contents):
Revision 1.78 by root, Sat Feb 4 15:17:22 2012 UTC vs.
Revision 1.82 by root, Fri Mar 23 19:05:22 2012 UTC

66/*****************************************************************************/ 66/*****************************************************************************/
67 67
68/* ECB_NO_THREADS - ecb is not used by multiple threads, ever */ 68/* ECB_NO_THREADS - ecb is not used by multiple threads, ever */
69/* ECB_NO_SMP - ecb might be used in multiple threads, but only on a single cpu */ 69/* ECB_NO_SMP - ecb might be used in multiple threads, but only on a single cpu */
70 70
71#if ECB_NO_THREADS
72# define ECB_NO_SMP 1
73#endif
74
71#if ECB_NO_THREADS || ECB_NO_SMP 75#if ECB_NO_THREADS || ECB_NO_SMP
72 #define ECB_MEMORY_FENCE do { } while (0) 76 #define ECB_MEMORY_FENCE do { } while (0)
73#endif 77#endif
74 78
75#ifndef ECB_MEMORY_FENCE 79#ifndef ECB_MEMORY_FENCE
94 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad | " : : : "memory") 98 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad | " : : : "memory")
95 #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory") 99 #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
96 #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore") 100 #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
97 #elif defined(__s390__) || defined(__s390x__) 101 #elif defined(__s390__) || defined(__s390x__)
98 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory") 102 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory")
103 #elif defined(__mips__)
104 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
99 #endif 105 #endif
100 #endif 106 #endif
101#endif 107#endif
102 108
103#ifndef ECB_MEMORY_FENCE 109#ifndef ECB_MEMORY_FENCE
116 #elif __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110 122 #elif __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
117 #include <mbarrier.h> 123 #include <mbarrier.h>
118 #define ECB_MEMORY_FENCE __machine_rw_barrier () 124 #define ECB_MEMORY_FENCE __machine_rw_barrier ()
119 #define ECB_MEMORY_FENCE_ACQUIRE __machine_r_barrier () 125 #define ECB_MEMORY_FENCE_ACQUIRE __machine_r_barrier ()
120 #define ECB_MEMORY_FENCE_RELEASE __machine_w_barrier () 126 #define ECB_MEMORY_FENCE_RELEASE __machine_w_barrier ()
127 #elif __xlC__
128 #define ECB_MEMORY_FENCE __lwsync ()
121 #endif 129 #endif
122#endif 130#endif
123 131
124#ifndef ECB_MEMORY_FENCE 132#ifndef ECB_MEMORY_FENCE
125 #if !ECB_AVOID_PTHREADS 133 #if !ECB_AVOID_PTHREADS

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines