comparison src/os/unix/ngx_gcc_atomic_ppc.h @ 935:db8e718447f1

use light-weight sync on ppc64
author Igor Sysoev <igor@sysoev.ru>
date Tue, 19 Dec 2006 15:23:20 +0000
parents 4745e72044fb
children fc1358d3d23a
comparison
equal deleted inserted replaced
934:4745e72044fb 935:db8e718447f1
65 : "cc", "memory"); 65 : "cc", "memory");
66 66
67 return res; 67 return res;
68 } 68 }
69 69
70
71 #if (NGX_SMP)
72 #define ngx_memory_barrier() __asm__ volatile ("lwsync\n" ::: "memory")
73 #else
74 #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
75 #endif
76
70 #else 77 #else
71 78
72 static ngx_inline ngx_atomic_uint_t 79 static ngx_inline ngx_atomic_uint_t
73 ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old, 80 ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
74 ngx_atomic_uint_t set) 81 ngx_atomic_uint_t set)
115 : "cc", "memory"); 122 : "cc", "memory");
116 123
117 return res; 124 return res;
118 } 125 }
119 126
120 #endif
121
122 127
123 #if (NGX_SMP) 128 #if (NGX_SMP)
124 #define ngx_memory_barrier() __asm__ volatile ("sync\n" ::: "memory") 129 #define ngx_memory_barrier() __asm__ volatile ("sync\n" ::: "memory")
125 #else 130 #else
126 #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory") 131 #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
127 #endif 132 #endif
128 133
134 #endif
135
136
129 #define ngx_cpu_pause() 137 #define ngx_cpu_pause()