usermode/library/atomic_ops/generalize-small.h

00001 /* char_load */
00002 #if defined(AO_HAVE_char_load_acquire) && !defined(AO_HAVE_char_load)
00003 #  define AO_char_load(addr) AO_char_load_acquire(addr)
00004 #  define AO_HAVE_char_load
00005 #endif
00006 
00007 #if defined(AO_HAVE_char_load_full) && !defined(AO_HAVE_char_load_acquire)
00008 #  define AO_char_load_acquire(addr) AO_char_load_full(addr)
00009 #  define AO_HAVE_char_load_acquire
00010 #endif
00011 
00012 #if defined(AO_HAVE_char_load_full) && !defined(AO_HAVE_char_load_read)
00013 #  define AO_char_load_read(addr) AO_char_load_full(addr)
00014 #  define AO_HAVE_char_load_read
00015 #endif
00016 
00017 #if !defined(AO_HAVE_char_load_acquire_read) && defined(AO_HAVE_char_load_acquire)
00018 #  define AO_char_load_acquire_read(addr) AO_char_load_acquire(addr)
00019 #  define AO_HAVE_char_load_acquire_read
00020 #endif
00021 
00022 #if defined(AO_HAVE_char_load) && defined(AO_HAVE_nop_full) && \
00023     !defined(AO_HAVE_char_load_acquire)
00024    AO_INLINE unsigned char
00025    AO_char_load_acquire(const volatile unsigned char *addr)
00026    {
00027      unsigned char result = AO_char_load(addr);
00028      /* Acquire barrier would be useless, since the load could be delayed  */
00029      /* beyond it.                                                         */
00030      AO_nop_full();
00031      return result;
00032    }
00033 #  define AO_HAVE_char_load_acquire
00034 #endif
00035 
00036 #if defined(AO_HAVE_char_load) && defined(AO_HAVE_nop_read) && \
00037     !defined(AO_HAVE_char_load_read)
00038    AO_INLINE unsigned char
00039    AO_char_load_read(const volatile unsigned char *addr)
00040    {
00041      unsigned char result = AO_char_load(addr);
00042      /* Acquire barrier would be useless, since the load could be delayed  */
00043      /* beyond it.                                                         */
00044      AO_nop_read();
00045      return result;
00046    }
00047 #  define AO_HAVE_char_load_read
00048 #endif
00049 
00050 #if defined(AO_HAVE_char_load_acquire) && defined(AO_HAVE_nop_full) && \
00051     !defined(AO_HAVE_char_load_full)
00052 #  define AO_char_load_full(addr) (AO_nop_full(), AO_char_load_acquire(addr))
00053 #  define AO_HAVE_char_load_full
00054 #endif
00055 
00056 #if !defined(AO_HAVE_char_load_acquire_read) && defined(AO_HAVE_char_load_read)
00057 #  define AO_char_load_acquire_read(addr) AO_char_load_read(addr)
00058 #  define AO_HAVE_char_load_acquire_read
00059 #endif
00060 
00061 #if defined(AO_HAVE_char_load_acquire_read) && !defined(AO_HAVE_char_load)
00062 #  define AO_char_load(addr) AO_char_load_acquire_read(addr)
00063 #  define AO_HAVE_char_load
00064 #endif
00065 
00066 #ifdef AO_NO_DD_ORDERING
00067 #  if defined(AO_HAVE_char_load_acquire_read)
00068 #    define AO_char_load_dd_acquire_read(addr) \
00069         AO_char_load_acquire_read(addr)
00070 #    define AO_HAVE_char_load_dd_acquire_read
00071 #  endif
00072 #else
00073 #  if defined(AO_HAVE_char_load)
00074 #    define AO_char_load_dd_acquire_read(addr) \
00075         AO_char_load(addr)
00076 #    define AO_HAVE_char_load_dd_acquire_read
00077 #  endif
00078 #endif
00079 
00080 
00081 /* char_store */
00082 
00083 #if defined(AO_HAVE_char_store_release) && !defined(AO_HAVE_char_store)
00084 #  define AO_char_store(addr, val) AO_char_store_release(addr,val)
00085 #  define AO_HAVE_char_store
00086 #endif
00087 
00088 #if defined(AO_HAVE_char_store_full) && !defined(AO_HAVE_char_store_release)
00089 #  define AO_char_store_release(addr,val) AO_char_store_full(addr,val)
00090 #  define AO_HAVE_char_store_release
00091 #endif
00092 
00093 #if defined(AO_HAVE_char_store_full) && !defined(AO_HAVE_char_store_write)
00094 #  define AO_char_store_write(addr,val) AO_char_store_full(addr,val)
00095 #  define AO_HAVE_char_store_write
00096 #endif
00097 
00098 #if defined(AO_HAVE_char_store_release) && \
00099         !defined(AO_HAVE_char_store_release_write)
00100 #  define AO_char_store_release_write(addr, val) \
00101         AO_char_store_release(addr,val)
00102 #  define AO_HAVE_char_store_release_write
00103 #endif
00104 
00105 #if defined(AO_HAVE_char_store_write) && !defined(AO_HAVE_char_store)
00106 #  define AO_char_store(addr, val) AO_char_store_write(addr,val)
00107 #  define AO_HAVE_char_store
00108 #endif
00109 
00110 #if defined(AO_HAVE_char_store) && defined(AO_HAVE_nop_full) && \
00111     !defined(AO_HAVE_char_store_release)
00112 #  define AO_char_store_release(addr,val) \
00113         (AO_nop_full(), AO_char_store(addr,val))
00114 #  define AO_HAVE_char_store_release
00115 #endif
00116 
00117 #if defined(AO_HAVE_nop_write) && defined(AO_HAVE_char_store) && \
00118      !defined(AO_HAVE_char_store_write)
00119 #  define AO_char_store_write(addr, val) \
00120         (AO_nop_write(), AO_char_store(addr,val))
00121 #  define AO_HAVE_char_store_write
00122 #endif
00123 
00124 #if defined(AO_HAVE_char_store_write) && \
00125      !defined(AO_HAVE_char_store_release_write)
00126 #  define AO_char_store_release_write(addr, val) AO_char_store_write(addr,val)
00127 #  define AO_HAVE_char_store_release_write
00128 #endif
00129 
00130 #if defined(AO_HAVE_char_store_release) && defined(AO_HAVE_nop_full) && \
00131     !defined(AO_HAVE_char_store_full)
00132 #  define AO_char_store_full(addr, val) \
00133         (AO_char_store_release(addr, val), AO_nop_full())
00134 #  define AO_HAVE_char_store_full
00135 #endif
00136 
00137 
00138 /* char_fetch_and_add */
00139 #if defined(AO_HAVE_char_compare_and_swap_full) && \
00140     !defined(AO_HAVE_char_fetch_and_add_full)
00141    AO_INLINE AO_t
00142    AO_char_fetch_and_add_full(volatile unsigned char *addr,
00143                                unsigned char incr)
00144    {
00145      unsigned char old;
00146      do
00147        {
00148          old = *addr;
00149        }
00150      while (!AO_char_compare_and_swap_full(addr, old, old+incr));
00151      return old;
00152    }
00153 #  define AO_HAVE_char_fetch_and_add_full
00154 #endif
00155 
00156 #if defined(AO_HAVE_char_compare_and_swap_acquire) && \
00157     !defined(AO_HAVE_char_fetch_and_add_acquire)
00158    AO_INLINE AO_t
00159    AO_char_fetch_and_add_acquire(volatile unsigned char *addr,
00160                                   unsigned char incr)
00161    {
00162      unsigned char old;
00163      do
00164        {
00165          old = *addr;
00166        }
00167      while (!AO_char_compare_and_swap_acquire(addr, old, old+incr));
00168      return old;
00169    }
00170 #  define AO_HAVE_char_fetch_and_add_acquire
00171 #endif
00172 
00173 #if defined(AO_HAVE_char_compare_and_swap_release) && \
00174     !defined(AO_HAVE_char_fetch_and_add_release)
00175    AO_INLINE AO_t
00176    AO_char_fetch_and_add_release(volatile unsigned char *addr,
00177                                   unsigned char incr)
00178    {
00179      unsigned char old;
00180      do
00181        {
00182          old = *addr;
00183        }
00184      while (!AO_char_compare_and_swap_release(addr, old, old+incr));
00185      return old;
00186    }
00187 #  define AO_HAVE_char_fetch_and_add_release
00188 #endif
00189 
00190 #if defined(AO_HAVE_char_fetch_and_add_full)
00191 #  if !defined(AO_HAVE_char_fetch_and_add_release)
00192 #    define AO_char_fetch_and_add_release(addr, val) \
00193          AO_char_fetch_and_add_full(addr, val)
00194 #    define AO_HAVE_char_fetch_and_add_release
00195 #  endif
00196 #  if !defined(AO_HAVE_char_fetch_and_add_acquire)
00197 #    define AO_char_fetch_and_add_acquire(addr, val) \
00198          AO_char_fetch_and_add_full(addr, val)
00199 #    define AO_HAVE_char_fetch_and_add_acquire
00200 #  endif
00201 #  if !defined(AO_HAVE_char_fetch_and_add_write)
00202 #    define AO_char_fetch_and_add_write(addr, val) \
00203          AO_char_fetch_and_add_full(addr, val)
00204 #    define AO_HAVE_char_fetch_and_add_write
00205 #  endif
00206 #  if !defined(AO_HAVE_char_fetch_and_add_read)
00207 #    define AO_char_fetch_and_add_read(addr, val) \
00208          AO_char_fetch_and_add_full(addr, val)
00209 #    define AO_HAVE_char_fetch_and_add_read
00210 #  endif
00211 #endif /* AO_HAVE_char_fetch_and_add_full */
00212 
00213 #if !defined(AO_HAVE_char_fetch_and_add) && \
00214     defined(AO_HAVE_char_fetch_and_add_release)
00215 #  define AO_char_fetch_and_add(addr, val) \
00216         AO_char_fetch_and_add_release(addr, val)
00217 #  define AO_HAVE_char_fetch_and_add
00218 #endif
00219 #if !defined(AO_HAVE_char_fetch_and_add) && \
00220     defined(AO_HAVE_char_fetch_and_add_acquire)
00221 #  define AO_char_fetch_and_add(addr, val) \
00222         AO_char_fetch_and_add_acquire(addr, val)
00223 #  define AO_HAVE_char_fetch_and_add
00224 #endif
00225 #if !defined(AO_HAVE_char_fetch_and_add) && \
00226     defined(AO_HAVE_char_fetch_and_add_write)
00227 #  define AO_char_fetch_and_add(addr, val) \
00228         AO_char_fetch_and_add_write(addr, val)
00229 #  define AO_HAVE_char_fetch_and_add
00230 #endif
00231 #if !defined(AO_HAVE_char_fetch_and_add) && \
00232     defined(AO_HAVE_char_fetch_and_add_read)
00233 #  define AO_char_fetch_and_add(addr, val) \
00234         AO_char_fetch_and_add_read(addr, val)
00235 #  define AO_HAVE_char_fetch_and_add
00236 #endif
00237 
00238 #if defined(AO_HAVE_char_fetch_and_add_acquire) &&\
00239     defined(AO_HAVE_nop_full) && \
00240     !defined(AO_HAVE_char_fetch_and_add_full)
00241 #  define AO_char_fetch_and_add_full(addr, val) \
00242         (AO_nop_full(), AO_char_fetch_and_add_acquire(addr, val))
00243 #endif
00244 
00245 #if !defined(AO_HAVE_char_fetch_and_add_release_write) && \
00246     defined(AO_HAVE_char_fetch_and_add_write)
00247 #  define AO_char_fetch_and_add_release_write(addr, val) \
00248         AO_char_fetch_and_add_write(addr, val)
00249 #  define AO_HAVE_char_fetch_and_add_release_write
00250 #endif
00251 #if !defined(AO_HAVE_char_fetch_and_add_release_write) && \
00252     defined(AO_HAVE_char_fetch_and_add_release)
00253 #  define AO_char_fetch_and_add_release_write(addr, val) \
00254         AO_char_fetch_and_add_release(addr, val)
00255 #  define AO_HAVE_char_fetch_and_add_release_write
00256 #endif
00257 #if !defined(AO_HAVE_char_fetch_and_add_acquire_read) && \
00258     defined(AO_HAVE_char_fetch_and_add_read)
00259 #  define AO_char_fetch_and_add_acquire_read(addr, val) \
00260         AO_char_fetch_and_add_read(addr, val)
00261 #  define AO_HAVE_char_fetch_and_add_acquire_read
00262 #endif
00263 #if !defined(AO_HAVE_char_fetch_and_add_acquire_read) && \
00264     defined(AO_HAVE_char_fetch_and_add_acquire)
00265 #  define AO_char_fetch_and_add_acquire_read(addr, val) \
00266         AO_char_fetch_and_add_acquire(addr, val)
00267 #  define AO_HAVE_char_fetch_and_add_acquire_read
00268 #endif
00269 
00270 #ifdef AO_NO_DD_ORDERING
00271 #  if defined(AO_HAVE_char_fetch_and_add_acquire_read)
00272 #    define AO_char_fetch_and_add_dd_acquire_read(addr, val) \
00273         AO_char_fetch_and_add_acquire_read(addr, val)
00274 #    define AO_HAVE_char_fetch_and_add_dd_acquire_read
00275 #  endif
00276 #else
00277 #  if defined(AO_HAVE_char_fetch_and_add)
00278 #    define AO_char_fetch_and_add_dd_acquire_read(addr, val) \
00279         AO_char_fetch_and_add(addr, val)
00280 #    define AO_HAVE_char_fetch_and_add_dd_acquire_read
00281 #  endif
00282 #endif
00283 
00284 /* char_fetch_and_add1 */
00285 
00286 #if defined(AO_HAVE_char_fetch_and_add_full) &&\
00287     !defined(AO_HAVE_char_fetch_and_add1_full)
00288 #  define AO_char_fetch_and_add1_full(addr) \
00289         AO_char_fetch_and_add_full(addr,1)
00290 #  define AO_HAVE_char_fetch_and_add1_full
00291 #endif
00292 #if defined(AO_HAVE_char_fetch_and_add_release) &&\
00293     !defined(AO_HAVE_char_fetch_and_add1_release)
00294 #  define AO_char_fetch_and_add1_release(addr) \
00295         AO_char_fetch_and_add_release(addr,1)
00296 #  define AO_HAVE_char_fetch_and_add1_release
00297 #endif
00298 #if defined(AO_HAVE_char_fetch_and_add_acquire) &&\
00299     !defined(AO_HAVE_char_fetch_and_add1_acquire)
00300 #  define AO_char_fetch_and_add1_acquire(addr) \
00301         AO_char_fetch_and_add_acquire(addr,1)
00302 #  define AO_HAVE_char_fetch_and_add1_acquire
00303 #endif
00304 #if defined(AO_HAVE_char_fetch_and_add_write) &&\
00305     !defined(AO_HAVE_char_fetch_and_add1_write)
00306 #  define AO_char_fetch_and_add1_write(addr) \
00307         AO_char_fetch_and_add_write(addr,1)
00308 #  define AO_HAVE_char_fetch_and_add1_write
00309 #endif
00310 #if defined(AO_HAVE_char_fetch_and_add_read) &&\
00311     !defined(AO_HAVE_char_fetch_and_add1_read)
00312 #  define AO_char_fetch_and_add1_read(addr) \
00313         AO_char_fetch_and_add_read(addr,1)
00314 #  define AO_HAVE_char_fetch_and_add1_read
00315 #endif
00316 #if defined(AO_HAVE_char_fetch_and_add_release_write) &&\
00317     !defined(AO_HAVE_char_fetch_and_add1_release_write)
00318 #  define AO_char_fetch_and_add1_release_write(addr) \
00319         AO_char_fetch_and_add_release_write(addr,1)
00320 #  define AO_HAVE_char_fetch_and_add1_release_write
00321 #endif
00322 #if defined(AO_HAVE_char_fetch_and_add_acquire_read) &&\
00323     !defined(AO_HAVE_char_fetch_and_add1_acquire_read)
00324 #  define AO_char_fetch_and_add1_acquire_read(addr) \
00325         AO_char_fetch_and_add_acquire_read(addr,1)
00326 #  define AO_HAVE_char_fetch_and_add1_acquire_read
00327 #endif
00328 #if defined(AO_HAVE_char_fetch_and_add) &&\
00329     !defined(AO_HAVE_char_fetch_and_add1)
00330 #  define AO_char_fetch_and_add1(addr) \
00331         AO_char_fetch_and_add(addr,1)
00332 #  define AO_HAVE_char_fetch_and_add1
00333 #endif
00334 
00335 #if defined(AO_HAVE_char_fetch_and_add1_full)
00336 #  if !defined(AO_HAVE_char_fetch_and_add1_release)
00337 #    define AO_char_fetch_and_add1_release(addr) \
00338          AO_char_fetch_and_add1_full(addr)
00339 #    define AO_HAVE_char_fetch_and_add1_release
00340 #  endif
00341 #  if !defined(AO_HAVE_char_fetch_and_add1_acquire)
00342 #    define AO_char_fetch_and_add1_acquire(addr) \
00343          AO_char_fetch_and_add1_full(addr)
00344 #    define AO_HAVE_char_fetch_and_add1_acquire
00345 #  endif
00346 #  if !defined(AO_HAVE_char_fetch_and_add1_write)
00347 #    define AO_char_fetch_and_add1_write(addr) \
00348          AO_char_fetch_and_add1_full(addr)
00349 #    define AO_HAVE_char_fetch_and_add1_write
00350 #  endif
00351 #  if !defined(AO_HAVE_char_fetch_and_add1_read)
00352 #    define AO_char_fetch_and_add1_read(addr) \
00353          AO_char_fetch_and_add1_full(addr)
00354 #    define AO_HAVE_char_fetch_and_add1_read
00355 #  endif
00356 #endif /* AO_HAVE_char_fetch_and_add1_full */
00357 
00358 #if !defined(AO_HAVE_char_fetch_and_add1) && \
00359     defined(AO_HAVE_char_fetch_and_add1_release)
00360 #  define AO_char_fetch_and_add1(addr) \
00361         AO_char_fetch_and_add1_release(addr)
00362 #  define AO_HAVE_char_fetch_and_add1
00363 #endif
00364 #if !defined(AO_HAVE_char_fetch_and_add1) && \
00365     defined(AO_HAVE_char_fetch_and_add1_acquire)
00366 #  define AO_char_fetch_and_add1(addr) \
00367         AO_char_fetch_and_add1_acquire(addr)
00368 #  define AO_HAVE_char_fetch_and_add1
00369 #endif
00370 #if !defined(AO_HAVE_char_fetch_and_add1) && \
00371     defined(AO_HAVE_char_fetch_and_add1_write)
00372 #  define AO_char_fetch_and_add1(addr) \
00373         AO_char_fetch_and_add1_write(addr)
00374 #  define AO_HAVE_char_fetch_and_add1
00375 #endif
00376 #if !defined(AO_HAVE_char_fetch_and_add1) && \
00377     defined(AO_HAVE_char_fetch_and_add1_read)
00378 #  define AO_char_fetch_and_add1(addr) \
00379         AO_char_fetch_and_add1_read(addr)
00380 #  define AO_HAVE_char_fetch_and_add1
00381 #endif
00382 
00383 #if defined(AO_HAVE_char_fetch_and_add1_acquire) &&\
00384     defined(AO_HAVE_nop_full) && \
00385     !defined(AO_HAVE_char_fetch_and_add1_full)
00386 #  define AO_char_fetch_and_add1_full(addr) \
00387         (AO_nop_full(), AO_char_fetch_and_add1_acquire(addr))
00388 #  define AO_HAVE_char_fetch_and_add1_full
00389 #endif
00390 
00391 #if !defined(AO_HAVE_char_fetch_and_add1_release_write) && \
00392     defined(AO_HAVE_char_fetch_and_add1_write)
00393 #  define AO_char_fetch_and_add1_release_write(addr) \
00394         AO_char_fetch_and_add1_write(addr)
00395 #  define AO_HAVE_char_fetch_and_add1_release_write
00396 #endif
00397 #if !defined(AO_HAVE_char_fetch_and_add1_release_write) && \
00398     defined(AO_HAVE_char_fetch_and_add1_release)
00399 #  define AO_char_fetch_and_add1_release_write(addr) \
00400         AO_char_fetch_and_add1_release(addr)
00401 #  define AO_HAVE_char_fetch_and_add1_release_write
00402 #endif
00403 #if !defined(AO_HAVE_char_fetch_and_add1_acquire_read) && \
00404     defined(AO_HAVE_char_fetch_and_add1_read)
00405 #  define AO_char_fetch_and_add1_acquire_read(addr) \
00406         AO_char_fetch_and_add1_read(addr)
00407 #  define AO_HAVE_char_fetch_and_add1_acquire_read
00408 #endif
00409 #if !defined(AO_HAVE_char_fetch_and_add1_acquire_read) && \
00410     defined(AO_HAVE_char_fetch_and_add1_acquire)
00411 #  define AO_char_fetch_and_add1_acquire_read(addr) \
00412         AO_char_fetch_and_add1_acquire(addr)
00413 #  define AO_HAVE_char_fetch_and_add1_acquire_read
00414 #endif
00415 
00416 #ifdef AO_NO_DD_ORDERING
00417 #  if defined(AO_HAVE_char_fetch_and_add1_acquire_read)
00418 #    define AO_char_fetch_and_add1_dd_acquire_read(addr) \
00419         AO_char_fetch_and_add1_acquire_read(addr)
00420 #    define AO_HAVE_char_fetch_and_add1_dd_acquire_read
00421 #  endif
00422 #else
00423 #  if defined(AO_HAVE_char_fetch_and_add1)
00424 #    define AO_char_fetch_and_add1_dd_acquire_read(addr) \
00425         AO_char_fetch_and_add1(addr)
00426 #    define AO_HAVE_char_fetch_and_add1_dd_acquire_read
00427 #  endif
00428 #endif
00429 
00430 /* char_fetch_and_sub1 */
00431 
00432 #if defined(AO_HAVE_char_fetch_and_add_full) &&\
00433     !defined(AO_HAVE_char_fetch_and_sub1_full)
00434 #  define AO_char_fetch_and_sub1_full(addr) \
00435         AO_char_fetch_and_add_full(addr,(unsigned char)(-1))
00436 #  define AO_HAVE_char_fetch_and_sub1_full
00437 #endif
00438 #if defined(AO_HAVE_char_fetch_and_add_release) &&\
00439     !defined(AO_HAVE_char_fetch_and_sub1_release)
00440 #  define AO_char_fetch_and_sub1_release(addr) \
00441         AO_char_fetch_and_add_release(addr,(unsigned char)(-1))
00442 #  define AO_HAVE_char_fetch_and_sub1_release
00443 #endif
00444 #if defined(AO_HAVE_char_fetch_and_add_acquire) &&\
00445     !defined(AO_HAVE_char_fetch_and_sub1_acquire)
00446 #  define AO_char_fetch_and_sub1_acquire(addr) \
00447         AO_char_fetch_and_add_acquire(addr,(unsigned char)(-1))
00448 #  define AO_HAVE_char_fetch_and_sub1_acquire
00449 #endif
00450 #if defined(AO_HAVE_char_fetch_and_add_write) &&\
00451     !defined(AO_HAVE_char_fetch_and_sub1_write)
00452 #  define AO_char_fetch_and_sub1_write(addr) \
00453         AO_char_fetch_and_add_write(addr,(unsigned char)(-1))
00454 #  define AO_HAVE_char_fetch_and_sub1_write
00455 #endif
00456 #if defined(AO_HAVE_char_fetch_and_add_read) &&\
00457     !defined(AO_HAVE_char_fetch_and_sub1_read)
00458 #  define AO_char_fetch_and_sub1_read(addr) \
00459         AO_char_fetch_and_add_read(addr,(unsigned char)(-1))
00460 #  define AO_HAVE_char_fetch_and_sub1_read
00461 #endif
00462 #if defined(AO_HAVE_char_fetch_and_add_release_write) &&\
00463     !defined(AO_HAVE_char_fetch_and_sub1_release_write)
00464 #  define AO_char_fetch_and_sub1_release_write(addr) \
00465         AO_char_fetch_and_add_release_write(addr,(unsigned char)(-1))
00466 #  define AO_HAVE_char_fetch_and_sub1_release_write
00467 #endif
00468 #if defined(AO_HAVE_char_fetch_and_add_acquire_read) &&\
00469     !defined(AO_HAVE_char_fetch_and_sub1_acquire_read)
00470 #  define AO_char_fetch_and_sub1_acquire_read(addr) \
00471         AO_char_fetch_and_add_acquire_read(addr,(unsigned char)(-1))
00472 #  define AO_HAVE_char_fetch_and_sub1_acquire_read
00473 #endif
00474 #if defined(AO_HAVE_char_fetch_and_add) &&\
00475     !defined(AO_HAVE_char_fetch_and_sub1)
00476 #  define AO_char_fetch_and_sub1(addr) \
00477         AO_char_fetch_and_add(addr,(unsigned char)(-1))
00478 #  define AO_HAVE_char_fetch_and_sub1
00479 #endif
00480 
00481 #if defined(AO_HAVE_char_fetch_and_sub1_full)
00482 #  if !defined(AO_HAVE_char_fetch_and_sub1_release)
00483 #    define AO_char_fetch_and_sub1_release(addr) \
00484          AO_char_fetch_and_sub1_full(addr)
00485 #    define AO_HAVE_char_fetch_and_sub1_release
00486 #  endif
00487 #  if !defined(AO_HAVE_char_fetch_and_sub1_acquire)
00488 #    define AO_char_fetch_and_sub1_acquire(addr) \
00489          AO_char_fetch_and_sub1_full(addr)
00490 #    define AO_HAVE_char_fetch_and_sub1_acquire
00491 #  endif
00492 #  if !defined(AO_HAVE_char_fetch_and_sub1_write)
00493 #    define AO_char_fetch_and_sub1_write(addr) \
00494          AO_char_fetch_and_sub1_full(addr)
00495 #    define AO_HAVE_char_fetch_and_sub1_write
00496 #  endif
00497 #  if !defined(AO_HAVE_char_fetch_and_sub1_read)
00498 #    define AO_char_fetch_and_sub1_read(addr) \
00499          AO_char_fetch_and_sub1_full(addr)
00500 #    define AO_HAVE_char_fetch_and_sub1_read
00501 #  endif
00502 #endif /* AO_HAVE_char_fetch_and_sub1_full */
00503 
00504 #if !defined(AO_HAVE_char_fetch_and_sub1) && \
00505     defined(AO_HAVE_char_fetch_and_sub1_release)
00506 #  define AO_char_fetch_and_sub1(addr) \
00507         AO_char_fetch_and_sub1_release(addr)
00508 #  define AO_HAVE_char_fetch_and_sub1
00509 #endif
00510 #if !defined(AO_HAVE_char_fetch_and_sub1) && \
00511     defined(AO_HAVE_char_fetch_and_sub1_acquire)
00512 #  define AO_char_fetch_and_sub1(addr) \
00513         AO_char_fetch_and_sub1_acquire(addr)
00514 #  define AO_HAVE_char_fetch_and_sub1
00515 #endif
00516 #if !defined(AO_HAVE_char_fetch_and_sub1) && \
00517     defined(AO_HAVE_char_fetch_and_sub1_write)
00518 #  define AO_char_fetch_and_sub1(addr) \
00519         AO_char_fetch_and_sub1_write(addr)
00520 #  define AO_HAVE_char_fetch_and_sub1
00521 #endif
00522 #if !defined(AO_HAVE_char_fetch_and_sub1) && \
00523     defined(AO_HAVE_char_fetch_and_sub1_read)
00524 #  define AO_char_fetch_and_sub1(addr) \
00525         AO_char_fetch_and_sub1_read(addr)
00526 #  define AO_HAVE_char_fetch_and_sub1
00527 #endif
00528 
00529 #if defined(AO_HAVE_char_fetch_and_sub1_acquire) &&\
00530     defined(AO_HAVE_nop_full) && \
00531     !defined(AO_HAVE_char_fetch_and_sub1_full)
00532 #  define AO_char_fetch_and_sub1_full(addr) \
00533         (AO_nop_full(), AO_char_fetch_and_sub1_acquire(addr))
00534 #  define AO_HAVE_char_fetch_and_sub1_full
00535 #endif
00536 
00537 #if !defined(AO_HAVE_char_fetch_and_sub1_release_write) && \
00538     defined(AO_HAVE_char_fetch_and_sub1_write)
00539 #  define AO_char_fetch_and_sub1_release_write(addr) \
00540         AO_char_fetch_and_sub1_write(addr)
00541 #  define AO_HAVE_char_fetch_and_sub1_release_write
00542 #endif
00543 #if !defined(AO_HAVE_char_fetch_and_sub1_release_write) && \
00544     defined(AO_HAVE_char_fetch_and_sub1_release)
00545 #  define AO_char_fetch_and_sub1_release_write(addr) \
00546         AO_char_fetch_and_sub1_release(addr)
00547 #  define AO_HAVE_char_fetch_and_sub1_release_write
00548 #endif
00549 #if !defined(AO_HAVE_char_fetch_and_sub1_acquire_read) && \
00550     defined(AO_HAVE_char_fetch_and_sub1_read)
00551 #  define AO_char_fetch_and_sub1_acquire_read(addr) \
00552         AO_char_fetch_and_sub1_read(addr)
00553 #  define AO_HAVE_char_fetch_and_sub1_acquire_read
00554 #endif
00555 #if !defined(AO_HAVE_char_fetch_and_sub1_acquire_read) && \
00556     defined(AO_HAVE_char_fetch_and_sub1_acquire)
00557 #  define AO_char_fetch_and_sub1_acquire_read(addr) \
00558         AO_char_fetch_and_sub1_acquire(addr)
00559 #  define AO_HAVE_char_fetch_and_sub1_acquire_read
00560 #endif
00561 
00562 #ifdef AO_NO_DD_ORDERING
00563 #  if defined(AO_HAVE_char_fetch_and_sub1_acquire_read)
00564 #    define AO_char_fetch_and_sub1_dd_acquire_read(addr) \
00565         AO_char_fetch_and_sub1_acquire_read(addr)
00566 #    define AO_HAVE_char_fetch_and_sub1_dd_acquire_read
00567 #  endif
00568 #else
00569 #  if defined(AO_HAVE_char_fetch_and_sub1)
00570 #    define AO_char_fetch_and_sub1_dd_acquire_read(addr) \
00571         AO_char_fetch_and_sub1(addr)
00572 #    define AO_HAVE_char_fetch_and_sub1_dd_acquire_read
00573 #  endif
00574 #endif
00575 
00576 /* short_load */
00577 #if defined(AO_HAVE_short_load_acquire) && !defined(AO_HAVE_short_load)
00578 #  define AO_short_load(addr) AO_short_load_acquire(addr)
00579 #  define AO_HAVE_short_load
00580 #endif
00581 
00582 #if defined(AO_HAVE_short_load_full) && !defined(AO_HAVE_short_load_acquire)
00583 #  define AO_short_load_acquire(addr) AO_short_load_full(addr)
00584 #  define AO_HAVE_short_load_acquire
00585 #endif
00586 
00587 #if defined(AO_HAVE_short_load_full) && !defined(AO_HAVE_short_load_read)
00588 #  define AO_short_load_read(addr) AO_short_load_full(addr)
00589 #  define AO_HAVE_short_load_read
00590 #endif
00591 
00592 #if !defined(AO_HAVE_short_load_acquire_read) && defined(AO_HAVE_short_load_acquire)
00593 #  define AO_short_load_acquire_read(addr) AO_short_load_acquire(addr)
00594 #  define AO_HAVE_short_load_acquire_read
00595 #endif
00596 
00597 #if defined(AO_HAVE_short_load) && defined(AO_HAVE_nop_full) && \
00598     !defined(AO_HAVE_short_load_acquire)
00599    AO_INLINE unsigned short
00600    AO_short_load_acquire(const volatile unsigned short *addr)
00601    {
00602      unsigned short result = AO_short_load(addr);
00603      /* Acquire barrier would be useless, since the load could be delayed  */
00604      /* beyond it.                                                         */
00605      AO_nop_full();
00606      return result;
00607    }
00608 #  define AO_HAVE_short_load_acquire
00609 #endif
00610 
00611 #if defined(AO_HAVE_short_load) && defined(AO_HAVE_nop_read) && \
00612     !defined(AO_HAVE_short_load_read)
00613    AO_INLINE unsigned short
00614    AO_short_load_read(const volatile unsigned short *addr)
00615    {
00616      unsigned short result = AO_short_load(addr);
00617      /* Acquire barrier would be useless, since the load could be delayed  */
00618      /* beyond it.                                                         */
00619      AO_nop_read();
00620      return result;
00621    }
00622 #  define AO_HAVE_short_load_read
00623 #endif
00624 
00625 #if defined(AO_HAVE_short_load_acquire) && defined(AO_HAVE_nop_full) && \
00626     !defined(AO_HAVE_short_load_full)
00627 #  define AO_short_load_full(addr) (AO_nop_full(), AO_short_load_acquire(addr))
00628 #  define AO_HAVE_short_load_full
00629 #endif
00630 
00631 #if !defined(AO_HAVE_short_load_acquire_read) && defined(AO_HAVE_short_load_read)
00632 #  define AO_short_load_acquire_read(addr) AO_short_load_read(addr)
00633 #  define AO_HAVE_short_load_acquire_read
00634 #endif
00635 
00636 #if defined(AO_HAVE_short_load_acquire_read) && !defined(AO_HAVE_short_load)
00637 #  define AO_short_load(addr) AO_short_load_acquire_read(addr)
00638 #  define AO_HAVE_short_load
00639 #endif
00640 
00641 #ifdef AO_NO_DD_ORDERING
00642 #  if defined(AO_HAVE_short_load_acquire_read)
00643 #    define AO_short_load_dd_acquire_read(addr) \
00644         AO_short_load_acquire_read(addr)
00645 #    define AO_HAVE_short_load_dd_acquire_read
00646 #  endif
00647 #else
00648 #  if defined(AO_HAVE_short_load)
00649 #    define AO_short_load_dd_acquire_read(addr) \
00650         AO_short_load(addr)
00651 #    define AO_HAVE_short_load_dd_acquire_read
00652 #  endif
00653 #endif
00654 
00655 
00656 /* short_store */
00657 
00658 #if defined(AO_HAVE_short_store_release) && !defined(AO_HAVE_short_store)
00659 #  define AO_short_store(addr, val) AO_short_store_release(addr,val)
00660 #  define AO_HAVE_short_store
00661 #endif
00662 
00663 #if defined(AO_HAVE_short_store_full) && !defined(AO_HAVE_short_store_release)
00664 #  define AO_short_store_release(addr,val) AO_short_store_full(addr,val)
00665 #  define AO_HAVE_short_store_release
00666 #endif
00667 
00668 #if defined(AO_HAVE_short_store_full) && !defined(AO_HAVE_short_store_write)
00669 #  define AO_short_store_write(addr,val) AO_short_store_full(addr,val)
00670 #  define AO_HAVE_short_store_write
00671 #endif
00672 
00673 #if defined(AO_HAVE_short_store_release) && \
00674         !defined(AO_HAVE_short_store_release_write)
00675 #  define AO_short_store_release_write(addr, val) \
00676         AO_short_store_release(addr,val)
00677 #  define AO_HAVE_short_store_release_write
00678 #endif
00679 
00680 #if defined(AO_HAVE_short_store_write) && !defined(AO_HAVE_short_store)
00681 #  define AO_short_store(addr, val) AO_short_store_write(addr,val)
00682 #  define AO_HAVE_short_store
00683 #endif
00684 
00685 #if defined(AO_HAVE_short_store) && defined(AO_HAVE_nop_full) && \
00686     !defined(AO_HAVE_short_store_release)
00687 #  define AO_short_store_release(addr,val) \
00688         (AO_nop_full(), AO_short_store(addr,val))
00689 #  define AO_HAVE_short_store_release
00690 #endif
00691 
00692 #if defined(AO_HAVE_nop_write) && defined(AO_HAVE_short_store) && \
00693      !defined(AO_HAVE_short_store_write)
00694 #  define AO_short_store_write(addr, val) \
00695         (AO_nop_write(), AO_short_store(addr,val))
00696 #  define AO_HAVE_short_store_write
00697 #endif
00698 
00699 #if defined(AO_HAVE_short_store_write) && \
00700      !defined(AO_HAVE_short_store_release_write)
00701 #  define AO_short_store_release_write(addr, val) AO_short_store_write(addr,val)
00702 #  define AO_HAVE_short_store_release_write
00703 #endif
00704 
00705 #if defined(AO_HAVE_short_store_release) && defined(AO_HAVE_nop_full) && \
00706     !defined(AO_HAVE_short_store_full)
00707 #  define AO_short_store_full(addr, val) \
00708         (AO_short_store_release(addr, val), AO_nop_full())
00709 #  define AO_HAVE_short_store_full
00710 #endif
00711 
00712 
00713 /* short_fetch_and_add */
00714 #if defined(AO_HAVE_short_compare_and_swap_full) && \
00715     !defined(AO_HAVE_short_fetch_and_add_full)
00716    AO_INLINE AO_t
00717    AO_short_fetch_and_add_full(volatile unsigned short *addr,
00718                                unsigned short incr)
00719    {
00720      unsigned short old;
00721      do
00722        {
00723          old = *addr;
00724        }
00725      while (!AO_short_compare_and_swap_full(addr, old, old+incr));
00726      return old;
00727    }
00728 #  define AO_HAVE_short_fetch_and_add_full
00729 #endif
00730 
00731 #if defined(AO_HAVE_short_compare_and_swap_acquire) && \
00732     !defined(AO_HAVE_short_fetch_and_add_acquire)
00733    AO_INLINE AO_t
00734    AO_short_fetch_and_add_acquire(volatile unsigned short *addr,
00735                                   unsigned short incr)
00736    {
00737      unsigned short old;
00738      do
00739        {
00740          old = *addr;
00741        }
00742      while (!AO_short_compare_and_swap_acquire(addr, old, old+incr));
00743      return old;
00744    }
00745 #  define AO_HAVE_short_fetch_and_add_acquire
00746 #endif
00747 
00748 #if defined(AO_HAVE_short_compare_and_swap_release) && \
00749     !defined(AO_HAVE_short_fetch_and_add_release)
00750    AO_INLINE AO_t
00751    AO_short_fetch_and_add_release(volatile unsigned short *addr,
00752                                   unsigned short incr)
00753    {
00754      unsigned short old;
00755      do
00756        {
00757          old = *addr;
00758        }
00759      while (!AO_short_compare_and_swap_release(addr, old, old+incr));
00760      return old;
00761    }
00762 #  define AO_HAVE_short_fetch_and_add_release
00763 #endif
00764 
00765 #if defined(AO_HAVE_short_fetch_and_add_full)
00766 #  if !defined(AO_HAVE_short_fetch_and_add_release)
00767 #    define AO_short_fetch_and_add_release(addr, val) \
00768          AO_short_fetch_and_add_full(addr, val)
00769 #    define AO_HAVE_short_fetch_and_add_release
00770 #  endif
00771 #  if !defined(AO_HAVE_short_fetch_and_add_acquire)
00772 #    define AO_short_fetch_and_add_acquire(addr, val) \
00773          AO_short_fetch_and_add_full(addr, val)
00774 #    define AO_HAVE_short_fetch_and_add_acquire
00775 #  endif
00776 #  if !defined(AO_HAVE_short_fetch_and_add_write)
00777 #    define AO_short_fetch_and_add_write(addr, val) \
00778          AO_short_fetch_and_add_full(addr, val)
00779 #    define AO_HAVE_short_fetch_and_add_write
00780 #  endif
00781 #  if !defined(AO_HAVE_short_fetch_and_add_read)
00782 #    define AO_short_fetch_and_add_read(addr, val) \
00783          AO_short_fetch_and_add_full(addr, val)
00784 #    define AO_HAVE_short_fetch_and_add_read
00785 #  endif
00786 #endif /* AO_HAVE_short_fetch_and_add_full */
00787 
00788 #if !defined(AO_HAVE_short_fetch_and_add) && \
00789     defined(AO_HAVE_short_fetch_and_add_release)
00790 #  define AO_short_fetch_and_add(addr, val) \
00791         AO_short_fetch_and_add_release(addr, val)
00792 #  define AO_HAVE_short_fetch_and_add
00793 #endif
00794 #if !defined(AO_HAVE_short_fetch_and_add) && \
00795     defined(AO_HAVE_short_fetch_and_add_acquire)
00796 #  define AO_short_fetch_and_add(addr, val) \
00797         AO_short_fetch_and_add_acquire(addr, val)
00798 #  define AO_HAVE_short_fetch_and_add
00799 #endif
00800 #if !defined(AO_HAVE_short_fetch_and_add) && \
00801     defined(AO_HAVE_short_fetch_and_add_write)
00802 #  define AO_short_fetch_and_add(addr, val) \
00803         AO_short_fetch_and_add_write(addr, val)
00804 #  define AO_HAVE_short_fetch_and_add
00805 #endif
00806 #if !defined(AO_HAVE_short_fetch_and_add) && \
00807     defined(AO_HAVE_short_fetch_and_add_read)
00808 #  define AO_short_fetch_and_add(addr, val) \
00809         AO_short_fetch_and_add_read(addr, val)
00810 #  define AO_HAVE_short_fetch_and_add
00811 #endif
00812 
00813 #if defined(AO_HAVE_short_fetch_and_add_acquire) &&\
00814     defined(AO_HAVE_nop_full) && \
00815     !defined(AO_HAVE_short_fetch_and_add_full)
00816 #  define AO_short_fetch_and_add_full(addr, val) \
00817         (AO_nop_full(), AO_short_fetch_and_add_acquire(addr, val))
00818 #endif
00819 
00820 #if !defined(AO_HAVE_short_fetch_and_add_release_write) && \
00821     defined(AO_HAVE_short_fetch_and_add_write)
00822 #  define AO_short_fetch_and_add_release_write(addr, val) \
00823         AO_short_fetch_and_add_write(addr, val)
00824 #  define AO_HAVE_short_fetch_and_add_release_write
00825 #endif
00826 #if !defined(AO_HAVE_short_fetch_and_add_release_write) && \
00827     defined(AO_HAVE_short_fetch_and_add_release)
00828 #  define AO_short_fetch_and_add_release_write(addr, val) \
00829         AO_short_fetch_and_add_release(addr, val)
00830 #  define AO_HAVE_short_fetch_and_add_release_write
00831 #endif
00832 #if !defined(AO_HAVE_short_fetch_and_add_acquire_read) && \
00833     defined(AO_HAVE_short_fetch_and_add_read)
00834 #  define AO_short_fetch_and_add_acquire_read(addr, val) \
00835         AO_short_fetch_and_add_read(addr, val)
00836 #  define AO_HAVE_short_fetch_and_add_acquire_read
00837 #endif
00838 #if !defined(AO_HAVE_short_fetch_and_add_acquire_read) && \
00839     defined(AO_HAVE_short_fetch_and_add_acquire)
00840 #  define AO_short_fetch_and_add_acquire_read(addr, val) \
00841         AO_short_fetch_and_add_acquire(addr, val)
00842 #  define AO_HAVE_short_fetch_and_add_acquire_read
00843 #endif
00844 
00845 #ifdef AO_NO_DD_ORDERING
00846 #  if defined(AO_HAVE_short_fetch_and_add_acquire_read)
00847 #    define AO_short_fetch_and_add_dd_acquire_read(addr, val) \
00848         AO_short_fetch_and_add_acquire_read(addr, val)
00849 #    define AO_HAVE_short_fetch_and_add_dd_acquire_read
00850 #  endif
00851 #else
00852 #  if defined(AO_HAVE_short_fetch_and_add)
00853 #    define AO_short_fetch_and_add_dd_acquire_read(addr, val) \
00854         AO_short_fetch_and_add(addr, val)
00855 #    define AO_HAVE_short_fetch_and_add_dd_acquire_read
00856 #  endif
00857 #endif
00858 
00859 /* short_fetch_and_add1 */
00860 
00861 #if defined(AO_HAVE_short_fetch_and_add_full) &&\
00862     !defined(AO_HAVE_short_fetch_and_add1_full)
00863 #  define AO_short_fetch_and_add1_full(addr) \
00864         AO_short_fetch_and_add_full(addr,1)
00865 #  define AO_HAVE_short_fetch_and_add1_full
00866 #endif
00867 #if defined(AO_HAVE_short_fetch_and_add_release) &&\
00868     !defined(AO_HAVE_short_fetch_and_add1_release)
00869 #  define AO_short_fetch_and_add1_release(addr) \
00870         AO_short_fetch_and_add_release(addr,1)
00871 #  define AO_HAVE_short_fetch_and_add1_release
00872 #endif
00873 #if defined(AO_HAVE_short_fetch_and_add_acquire) &&\
00874     !defined(AO_HAVE_short_fetch_and_add1_acquire)
00875 #  define AO_short_fetch_and_add1_acquire(addr) \
00876         AO_short_fetch_and_add_acquire(addr,1)
00877 #  define AO_HAVE_short_fetch_and_add1_acquire
00878 #endif
00879 #if defined(AO_HAVE_short_fetch_and_add_write) &&\
00880     !defined(AO_HAVE_short_fetch_and_add1_write)
00881 #  define AO_short_fetch_and_add1_write(addr) \
00882         AO_short_fetch_and_add_write(addr,1)
00883 #  define AO_HAVE_short_fetch_and_add1_write
00884 #endif
00885 #if defined(AO_HAVE_short_fetch_and_add_read) &&\
00886     !defined(AO_HAVE_short_fetch_and_add1_read)
00887 #  define AO_short_fetch_and_add1_read(addr) \
00888         AO_short_fetch_and_add_read(addr,1)
00889 #  define AO_HAVE_short_fetch_and_add1_read
00890 #endif
00891 #if defined(AO_HAVE_short_fetch_and_add_release_write) &&\
00892     !defined(AO_HAVE_short_fetch_and_add1_release_write)
00893 #  define AO_short_fetch_and_add1_release_write(addr) \
00894         AO_short_fetch_and_add_release_write(addr,1)
00895 #  define AO_HAVE_short_fetch_and_add1_release_write
00896 #endif
00897 #if defined(AO_HAVE_short_fetch_and_add_acquire_read) &&\
00898     !defined(AO_HAVE_short_fetch_and_add1_acquire_read)
00899 #  define AO_short_fetch_and_add1_acquire_read(addr) \
00900         AO_short_fetch_and_add_acquire_read(addr,1)
00901 #  define AO_HAVE_short_fetch_and_add1_acquire_read
00902 #endif
00903 #if defined(AO_HAVE_short_fetch_and_add) &&\
00904     !defined(AO_HAVE_short_fetch_and_add1)
00905 #  define AO_short_fetch_and_add1(addr) \
00906         AO_short_fetch_and_add(addr,1)
00907 #  define AO_HAVE_short_fetch_and_add1
00908 #endif
00909 
00910 #if defined(AO_HAVE_short_fetch_and_add1_full)
00911 #  if !defined(AO_HAVE_short_fetch_and_add1_release)
00912 #    define AO_short_fetch_and_add1_release(addr) \
00913          AO_short_fetch_and_add1_full(addr)
00914 #    define AO_HAVE_short_fetch_and_add1_release
00915 #  endif
00916 #  if !defined(AO_HAVE_short_fetch_and_add1_acquire)
00917 #    define AO_short_fetch_and_add1_acquire(addr) \
00918          AO_short_fetch_and_add1_full(addr)
00919 #    define AO_HAVE_short_fetch_and_add1_acquire
00920 #  endif
00921 #  if !defined(AO_HAVE_short_fetch_and_add1_write)
00922 #    define AO_short_fetch_and_add1_write(addr) \
00923          AO_short_fetch_and_add1_full(addr)
00924 #    define AO_HAVE_short_fetch_and_add1_write
00925 #  endif
00926 #  if !defined(AO_HAVE_short_fetch_and_add1_read)
00927 #    define AO_short_fetch_and_add1_read(addr) \
00928          AO_short_fetch_and_add1_full(addr)
00929 #    define AO_HAVE_short_fetch_and_add1_read
00930 #  endif
00931 #endif /* AO_HAVE_short_fetch_and_add1_full */
00932 
00933 #if !defined(AO_HAVE_short_fetch_and_add1) && \
00934     defined(AO_HAVE_short_fetch_and_add1_release)
00935 #  define AO_short_fetch_and_add1(addr) \
00936         AO_short_fetch_and_add1_release(addr)
00937 #  define AO_HAVE_short_fetch_and_add1
00938 #endif
00939 #if !defined(AO_HAVE_short_fetch_and_add1) && \
00940     defined(AO_HAVE_short_fetch_and_add1_acquire)
00941 #  define AO_short_fetch_and_add1(addr) \
00942         AO_short_fetch_and_add1_acquire(addr)
00943 #  define AO_HAVE_short_fetch_and_add1
00944 #endif
00945 #if !defined(AO_HAVE_short_fetch_and_add1) && \
00946     defined(AO_HAVE_short_fetch_and_add1_write)
00947 #  define AO_short_fetch_and_add1(addr) \
00948         AO_short_fetch_and_add1_write(addr)
00949 #  define AO_HAVE_short_fetch_and_add1
00950 #endif
00951 #if !defined(AO_HAVE_short_fetch_and_add1) && \
00952     defined(AO_HAVE_short_fetch_and_add1_read)
00953 #  define AO_short_fetch_and_add1(addr) \
00954         AO_short_fetch_and_add1_read(addr)
00955 #  define AO_HAVE_short_fetch_and_add1
00956 #endif
00957 
00958 #if defined(AO_HAVE_short_fetch_and_add1_acquire) &&\
00959     defined(AO_HAVE_nop_full) && \
00960     !defined(AO_HAVE_short_fetch_and_add1_full)
00961 #  define AO_short_fetch_and_add1_full(addr) \
00962         (AO_nop_full(), AO_short_fetch_and_add1_acquire(addr))
00963 #  define AO_HAVE_short_fetch_and_add1_full
00964 #endif
00965 
00966 #if !defined(AO_HAVE_short_fetch_and_add1_release_write) && \
00967     defined(AO_HAVE_short_fetch_and_add1_write)
00968 #  define AO_short_fetch_and_add1_release_write(addr) \
00969         AO_short_fetch_and_add1_write(addr)
00970 #  define AO_HAVE_short_fetch_and_add1_release_write
00971 #endif
00972 #if !defined(AO_HAVE_short_fetch_and_add1_release_write) && \
00973     defined(AO_HAVE_short_fetch_and_add1_release)
00974 #  define AO_short_fetch_and_add1_release_write(addr) \
00975         AO_short_fetch_and_add1_release(addr)
00976 #  define AO_HAVE_short_fetch_and_add1_release_write
00977 #endif
00978 #if !defined(AO_HAVE_short_fetch_and_add1_acquire_read) && \
00979     defined(AO_HAVE_short_fetch_and_add1_read)
00980 #  define AO_short_fetch_and_add1_acquire_read(addr) \
00981         AO_short_fetch_and_add1_read(addr)
00982 #  define AO_HAVE_short_fetch_and_add1_acquire_read
00983 #endif
00984 #if !defined(AO_HAVE_short_fetch_and_add1_acquire_read) && \
00985     defined(AO_HAVE_short_fetch_and_add1_acquire)
00986 #  define AO_short_fetch_and_add1_acquire_read(addr) \
00987         AO_short_fetch_and_add1_acquire(addr)
00988 #  define AO_HAVE_short_fetch_and_add1_acquire_read
00989 #endif
00990 
00991 #ifdef AO_NO_DD_ORDERING
00992 #  if defined(AO_HAVE_short_fetch_and_add1_acquire_read)
00993 #    define AO_short_fetch_and_add1_dd_acquire_read(addr) \
00994         AO_short_fetch_and_add1_acquire_read(addr)
00995 #    define AO_HAVE_short_fetch_and_add1_dd_acquire_read
00996 #  endif
00997 #else
00998 #  if defined(AO_HAVE_short_fetch_and_add1)
00999 #    define AO_short_fetch_and_add1_dd_acquire_read(addr) \
01000         AO_short_fetch_and_add1(addr)
01001 #    define AO_HAVE_short_fetch_and_add1_dd_acquire_read
01002 #  endif
01003 #endif
01004 
01005 /* short_fetch_and_sub1 */
01006 
01007 #if defined(AO_HAVE_short_fetch_and_add_full) &&\
01008     !defined(AO_HAVE_short_fetch_and_sub1_full)
01009 #  define AO_short_fetch_and_sub1_full(addr) \
01010         AO_short_fetch_and_add_full(addr,(unsigned short)(-1))
01011 #  define AO_HAVE_short_fetch_and_sub1_full
01012 #endif
01013 #if defined(AO_HAVE_short_fetch_and_add_release) &&\
01014     !defined(AO_HAVE_short_fetch_and_sub1_release)
01015 #  define AO_short_fetch_and_sub1_release(addr) \
01016         AO_short_fetch_and_add_release(addr,(unsigned short)(-1))
01017 #  define AO_HAVE_short_fetch_and_sub1_release
01018 #endif
01019 #if defined(AO_HAVE_short_fetch_and_add_acquire) &&\
01020     !defined(AO_HAVE_short_fetch_and_sub1_acquire)
01021 #  define AO_short_fetch_and_sub1_acquire(addr) \
01022         AO_short_fetch_and_add_acquire(addr,(unsigned short)(-1))
01023 #  define AO_HAVE_short_fetch_and_sub1_acquire
01024 #endif
01025 #if defined(AO_HAVE_short_fetch_and_add_write) &&\
01026     !defined(AO_HAVE_short_fetch_and_sub1_write)
01027 #  define AO_short_fetch_and_sub1_write(addr) \
01028         AO_short_fetch_and_add_write(addr,(unsigned short)(-1))
01029 #  define AO_HAVE_short_fetch_and_sub1_write
01030 #endif
01031 #if defined(AO_HAVE_short_fetch_and_add_read) &&\
01032     !defined(AO_HAVE_short_fetch_and_sub1_read)
01033 #  define AO_short_fetch_and_sub1_read(addr) \
01034         AO_short_fetch_and_add_read(addr,(unsigned short)(-1))
01035 #  define AO_HAVE_short_fetch_and_sub1_read
01036 #endif
01037 #if defined(AO_HAVE_short_fetch_and_add_release_write) &&\
01038     !defined(AO_HAVE_short_fetch_and_sub1_release_write)
01039 #  define AO_short_fetch_and_sub1_release_write(addr) \
01040         AO_short_fetch_and_add_release_write(addr,(unsigned short)(-1))
01041 #  define AO_HAVE_short_fetch_and_sub1_release_write
01042 #endif
01043 #if defined(AO_HAVE_short_fetch_and_add_acquire_read) &&\
01044     !defined(AO_HAVE_short_fetch_and_sub1_acquire_read)
01045 #  define AO_short_fetch_and_sub1_acquire_read(addr) \
01046         AO_short_fetch_and_add_acquire_read(addr,(unsigned short)(-1))
01047 #  define AO_HAVE_short_fetch_and_sub1_acquire_read
01048 #endif
01049 #if defined(AO_HAVE_short_fetch_and_add) &&\
01050     !defined(AO_HAVE_short_fetch_and_sub1)
01051 #  define AO_short_fetch_and_sub1(addr) \
01052         AO_short_fetch_and_add(addr,(unsigned short)(-1))
01053 #  define AO_HAVE_short_fetch_and_sub1
01054 #endif
01055 
01056 #if defined(AO_HAVE_short_fetch_and_sub1_full)
01057 #  if !defined(AO_HAVE_short_fetch_and_sub1_release)
01058 #    define AO_short_fetch_and_sub1_release(addr) \
01059          AO_short_fetch_and_sub1_full(addr)
01060 #    define AO_HAVE_short_fetch_and_sub1_release
01061 #  endif
01062 #  if !defined(AO_HAVE_short_fetch_and_sub1_acquire)
01063 #    define AO_short_fetch_and_sub1_acquire(addr) \
01064          AO_short_fetch_and_sub1_full(addr)
01065 #    define AO_HAVE_short_fetch_and_sub1_acquire
01066 #  endif
01067 #  if !defined(AO_HAVE_short_fetch_and_sub1_write)
01068 #    define AO_short_fetch_and_sub1_write(addr) \
01069          AO_short_fetch_and_sub1_full(addr)
01070 #    define AO_HAVE_short_fetch_and_sub1_write
01071 #  endif
01072 #  if !defined(AO_HAVE_short_fetch_and_sub1_read)
01073 #    define AO_short_fetch_and_sub1_read(addr) \
01074          AO_short_fetch_and_sub1_full(addr)
01075 #    define AO_HAVE_short_fetch_and_sub1_read
01076 #  endif
01077 #endif /* AO_HAVE_short_fetch_and_sub1_full */
01078 
01079 #if !defined(AO_HAVE_short_fetch_and_sub1) && \
01080     defined(AO_HAVE_short_fetch_and_sub1_release)
01081 #  define AO_short_fetch_and_sub1(addr) \
01082         AO_short_fetch_and_sub1_release(addr)
01083 #  define AO_HAVE_short_fetch_and_sub1
01084 #endif
01085 #if !defined(AO_HAVE_short_fetch_and_sub1) && \
01086     defined(AO_HAVE_short_fetch_and_sub1_acquire)
01087 #  define AO_short_fetch_and_sub1(addr) \
01088         AO_short_fetch_and_sub1_acquire(addr)
01089 #  define AO_HAVE_short_fetch_and_sub1
01090 #endif
01091 #if !defined(AO_HAVE_short_fetch_and_sub1) && \
01092     defined(AO_HAVE_short_fetch_and_sub1_write)
01093 #  define AO_short_fetch_and_sub1(addr) \
01094         AO_short_fetch_and_sub1_write(addr)
01095 #  define AO_HAVE_short_fetch_and_sub1
01096 #endif
01097 #if !defined(AO_HAVE_short_fetch_and_sub1) && \
01098     defined(AO_HAVE_short_fetch_and_sub1_read)
01099 #  define AO_short_fetch_and_sub1(addr) \
01100         AO_short_fetch_and_sub1_read(addr)
01101 #  define AO_HAVE_short_fetch_and_sub1
01102 #endif
01103 
01104 #if defined(AO_HAVE_short_fetch_and_sub1_acquire) &&\
01105     defined(AO_HAVE_nop_full) && \
01106     !defined(AO_HAVE_short_fetch_and_sub1_full)
01107 #  define AO_short_fetch_and_sub1_full(addr) \
01108         (AO_nop_full(), AO_short_fetch_and_sub1_acquire(addr))
01109 #  define AO_HAVE_short_fetch_and_sub1_full
01110 #endif
01111 
01112 #if !defined(AO_HAVE_short_fetch_and_sub1_release_write) && \
01113     defined(AO_HAVE_short_fetch_and_sub1_write)
01114 #  define AO_short_fetch_and_sub1_release_write(addr) \
01115         AO_short_fetch_and_sub1_write(addr)
01116 #  define AO_HAVE_short_fetch_and_sub1_release_write
01117 #endif
01118 #if !defined(AO_HAVE_short_fetch_and_sub1_release_write) && \
01119     defined(AO_HAVE_short_fetch_and_sub1_release)
01120 #  define AO_short_fetch_and_sub1_release_write(addr) \
01121         AO_short_fetch_and_sub1_release(addr)
01122 #  define AO_HAVE_short_fetch_and_sub1_release_write
01123 #endif
01124 #if !defined(AO_HAVE_short_fetch_and_sub1_acquire_read) && \
01125     defined(AO_HAVE_short_fetch_and_sub1_read)
01126 #  define AO_short_fetch_and_sub1_acquire_read(addr) \
01127         AO_short_fetch_and_sub1_read(addr)
01128 #  define AO_HAVE_short_fetch_and_sub1_acquire_read
01129 #endif
01130 #if !defined(AO_HAVE_short_fetch_and_sub1_acquire_read) && \
01131     defined(AO_HAVE_short_fetch_and_sub1_acquire)
01132 #  define AO_short_fetch_and_sub1_acquire_read(addr) \
01133         AO_short_fetch_and_sub1_acquire(addr)
01134 #  define AO_HAVE_short_fetch_and_sub1_acquire_read
01135 #endif
01136 
01137 #ifdef AO_NO_DD_ORDERING
01138 #  if defined(AO_HAVE_short_fetch_and_sub1_acquire_read)
01139 #    define AO_short_fetch_and_sub1_dd_acquire_read(addr) \
01140         AO_short_fetch_and_sub1_acquire_read(addr)
01141 #    define AO_HAVE_short_fetch_and_sub1_dd_acquire_read
01142 #  endif
01143 #else
01144 #  if defined(AO_HAVE_short_fetch_and_sub1)
01145 #    define AO_short_fetch_and_sub1_dd_acquire_read(addr) \
01146         AO_short_fetch_and_sub1(addr)
01147 #    define AO_HAVE_short_fetch_and_sub1_dd_acquire_read
01148 #  endif
01149 #endif
01150 
01151 /* int_load */
01152 #if defined(AO_HAVE_int_load_acquire) && !defined(AO_HAVE_int_load)
01153 #  define AO_int_load(addr) AO_int_load_acquire(addr)
01154 #  define AO_HAVE_int_load
01155 #endif
01156 
01157 #if defined(AO_HAVE_int_load_full) && !defined(AO_HAVE_int_load_acquire)
01158 #  define AO_int_load_acquire(addr) AO_int_load_full(addr)
01159 #  define AO_HAVE_int_load_acquire
01160 #endif
01161 
01162 #if defined(AO_HAVE_int_load_full) && !defined(AO_HAVE_int_load_read)
01163 #  define AO_int_load_read(addr) AO_int_load_full(addr)
01164 #  define AO_HAVE_int_load_read
01165 #endif
01166 
01167 #if !defined(AO_HAVE_int_load_acquire_read) && defined(AO_HAVE_int_load_acquire)
01168 #  define AO_int_load_acquire_read(addr) AO_int_load_acquire(addr)
01169 #  define AO_HAVE_int_load_acquire_read
01170 #endif
01171 
01172 #if defined(AO_HAVE_int_load) && defined(AO_HAVE_nop_full) && \
01173     !defined(AO_HAVE_int_load_acquire)
01174    AO_INLINE unsigned int
01175    AO_int_load_acquire(const volatile unsigned int *addr)
01176    {
01177      unsigned int result = AO_int_load(addr);
01178      /* Acquire barrier would be useless, since the load could be delayed  */
01179      /* beyond it.                                                         */
01180      AO_nop_full();
01181      return result;
01182    }
01183 #  define AO_HAVE_int_load_acquire
01184 #endif
01185 
01186 #if defined(AO_HAVE_int_load) && defined(AO_HAVE_nop_read) && \
01187     !defined(AO_HAVE_int_load_read)
01188    AO_INLINE unsigned int
01189    AO_int_load_read(const volatile unsigned int *addr)
01190    {
01191      unsigned int result = AO_int_load(addr);
01192      /* Acquire barrier would be useless, since the load could be delayed  */
01193      /* beyond it.                                                         */
01194      AO_nop_read();
01195      return result;
01196    }
01197 #  define AO_HAVE_int_load_read
01198 #endif
01199 
01200 #if defined(AO_HAVE_int_load_acquire) && defined(AO_HAVE_nop_full) && \
01201     !defined(AO_HAVE_int_load_full)
01202 #  define AO_int_load_full(addr) (AO_nop_full(), AO_int_load_acquire(addr))
01203 #  define AO_HAVE_int_load_full
01204 #endif
01205 
01206 #if !defined(AO_HAVE_int_load_acquire_read) && defined(AO_HAVE_int_load_read)
01207 #  define AO_int_load_acquire_read(addr) AO_int_load_read(addr)
01208 #  define AO_HAVE_int_load_acquire_read
01209 #endif
01210 
01211 #if defined(AO_HAVE_int_load_acquire_read) && !defined(AO_HAVE_int_load)
01212 #  define AO_int_load(addr) AO_int_load_acquire_read(addr)
01213 #  define AO_HAVE_int_load
01214 #endif
01215 
01216 #ifdef AO_NO_DD_ORDERING
01217 #  if defined(AO_HAVE_int_load_acquire_read)
01218 #    define AO_int_load_dd_acquire_read(addr) \
01219         AO_int_load_acquire_read(addr)
01220 #    define AO_HAVE_int_load_dd_acquire_read
01221 #  endif
01222 #else
01223 #  if defined(AO_HAVE_int_load)
01224 #    define AO_int_load_dd_acquire_read(addr) \
01225         AO_int_load(addr)
01226 #    define AO_HAVE_int_load_dd_acquire_read
01227 #  endif
01228 #endif
01229 
01230 
01231 /* int_store */
01232 
01233 #if defined(AO_HAVE_int_store_release) && !defined(AO_HAVE_int_store)
01234 #  define AO_int_store(addr, val) AO_int_store_release(addr,val)
01235 #  define AO_HAVE_int_store
01236 #endif
01237 
01238 #if defined(AO_HAVE_int_store_full) && !defined(AO_HAVE_int_store_release)
01239 #  define AO_int_store_release(addr,val) AO_int_store_full(addr,val)
01240 #  define AO_HAVE_int_store_release
01241 #endif
01242 
01243 #if defined(AO_HAVE_int_store_full) && !defined(AO_HAVE_int_store_write)
01244 #  define AO_int_store_write(addr,val) AO_int_store_full(addr,val)
01245 #  define AO_HAVE_int_store_write
01246 #endif
01247 
01248 #if defined(AO_HAVE_int_store_release) && \
01249         !defined(AO_HAVE_int_store_release_write)
01250 #  define AO_int_store_release_write(addr, val) \
01251         AO_int_store_release(addr,val)
01252 #  define AO_HAVE_int_store_release_write
01253 #endif
01254 
01255 #if defined(AO_HAVE_int_store_write) && !defined(AO_HAVE_int_store)
01256 #  define AO_int_store(addr, val) AO_int_store_write(addr,val)
01257 #  define AO_HAVE_int_store
01258 #endif
01259 
01260 #if defined(AO_HAVE_int_store) && defined(AO_HAVE_nop_full) && \
01261     !defined(AO_HAVE_int_store_release)
01262 #  define AO_int_store_release(addr,val) \
01263         (AO_nop_full(), AO_int_store(addr,val))
01264 #  define AO_HAVE_int_store_release
01265 #endif
01266 
01267 #if defined(AO_HAVE_nop_write) && defined(AO_HAVE_int_store) && \
01268      !defined(AO_HAVE_int_store_write)
01269 #  define AO_int_store_write(addr, val) \
01270         (AO_nop_write(), AO_int_store(addr,val))
01271 #  define AO_HAVE_int_store_write
01272 #endif
01273 
01274 #if defined(AO_HAVE_int_store_write) && \
01275      !defined(AO_HAVE_int_store_release_write)
01276 #  define AO_int_store_release_write(addr, val) AO_int_store_write(addr,val)
01277 #  define AO_HAVE_int_store_release_write
01278 #endif
01279 
01280 #if defined(AO_HAVE_int_store_release) && defined(AO_HAVE_nop_full) && \
01281     !defined(AO_HAVE_int_store_full)
01282 #  define AO_int_store_full(addr, val) \
01283         (AO_int_store_release(addr, val), AO_nop_full())
01284 #  define AO_HAVE_int_store_full
01285 #endif
01286 
01287 
01288 /* int_fetch_and_add */
01289 #if defined(AO_HAVE_int_compare_and_swap_full) && \
01290     !defined(AO_HAVE_int_fetch_and_add_full)
01291    AO_INLINE AO_t
01292    AO_int_fetch_and_add_full(volatile unsigned int *addr,
01293                                unsigned int incr)
01294    {
01295      unsigned int old;
01296      do
01297        {
01298          old = *addr;
01299        }
01300      while (!AO_int_compare_and_swap_full(addr, old, old+incr));
01301      return old;
01302    }
01303 #  define AO_HAVE_int_fetch_and_add_full
01304 #endif
01305 
01306 #if defined(AO_HAVE_int_compare_and_swap_acquire) && \
01307     !defined(AO_HAVE_int_fetch_and_add_acquire)
01308    AO_INLINE AO_t
01309    AO_int_fetch_and_add_acquire(volatile unsigned int *addr,
01310                                   unsigned int incr)
01311    {
01312      unsigned int old;
01313      do
01314        {
01315          old = *addr;
01316        }
01317      while (!AO_int_compare_and_swap_acquire(addr, old, old+incr));
01318      return old;
01319    }
01320 #  define AO_HAVE_int_fetch_and_add_acquire
01321 #endif
01322 
01323 #if defined(AO_HAVE_int_compare_and_swap_release) && \
01324     !defined(AO_HAVE_int_fetch_and_add_release)
01325    AO_INLINE AO_t
01326    AO_int_fetch_and_add_release(volatile unsigned int *addr,
01327                                   unsigned int incr)
01328    {
01329      unsigned int old;
01330      do
01331        {
01332          old = *addr;
01333        }
01334      while (!AO_int_compare_and_swap_release(addr, old, old+incr));
01335      return old;
01336    }
01337 #  define AO_HAVE_int_fetch_and_add_release
01338 #endif
01339 
01340 #if defined(AO_HAVE_int_fetch_and_add_full)
01341 #  if !defined(AO_HAVE_int_fetch_and_add_release)
01342 #    define AO_int_fetch_and_add_release(addr, val) \
01343          AO_int_fetch_and_add_full(addr, val)
01344 #    define AO_HAVE_int_fetch_and_add_release
01345 #  endif
01346 #  if !defined(AO_HAVE_int_fetch_and_add_acquire)
01347 #    define AO_int_fetch_and_add_acquire(addr, val) \
01348          AO_int_fetch_and_add_full(addr, val)
01349 #    define AO_HAVE_int_fetch_and_add_acquire
01350 #  endif
01351 #  if !defined(AO_HAVE_int_fetch_and_add_write)
01352 #    define AO_int_fetch_and_add_write(addr, val) \
01353          AO_int_fetch_and_add_full(addr, val)
01354 #    define AO_HAVE_int_fetch_and_add_write
01355 #  endif
01356 #  if !defined(AO_HAVE_int_fetch_and_add_read)
01357 #    define AO_int_fetch_and_add_read(addr, val) \
01358          AO_int_fetch_and_add_full(addr, val)
01359 #    define AO_HAVE_int_fetch_and_add_read
01360 #  endif
01361 #endif /* AO_HAVE_int_fetch_and_add_full */
01362 
01363 #if !defined(AO_HAVE_int_fetch_and_add) && \
01364     defined(AO_HAVE_int_fetch_and_add_release)
01365 #  define AO_int_fetch_and_add(addr, val) \
01366         AO_int_fetch_and_add_release(addr, val)
01367 #  define AO_HAVE_int_fetch_and_add
01368 #endif
01369 #if !defined(AO_HAVE_int_fetch_and_add) && \
01370     defined(AO_HAVE_int_fetch_and_add_acquire)
01371 #  define AO_int_fetch_and_add(addr, val) \
01372         AO_int_fetch_and_add_acquire(addr, val)
01373 #  define AO_HAVE_int_fetch_and_add
01374 #endif
01375 #if !defined(AO_HAVE_int_fetch_and_add) && \
01376     defined(AO_HAVE_int_fetch_and_add_write)
01377 #  define AO_int_fetch_and_add(addr, val) \
01378         AO_int_fetch_and_add_write(addr, val)
01379 #  define AO_HAVE_int_fetch_and_add
01380 #endif
01381 #if !defined(AO_HAVE_int_fetch_and_add) && \
01382     defined(AO_HAVE_int_fetch_and_add_read)
01383 #  define AO_int_fetch_and_add(addr, val) \
01384         AO_int_fetch_and_add_read(addr, val)
01385 #  define AO_HAVE_int_fetch_and_add
01386 #endif
01387 
01388 #if defined(AO_HAVE_int_fetch_and_add_acquire) &&\
01389     defined(AO_HAVE_nop_full) && \
01390     !defined(AO_HAVE_int_fetch_and_add_full)
01391 #  define AO_int_fetch_and_add_full(addr, val) \
01392         (AO_nop_full(), AO_int_fetch_and_add_acquire(addr, val))
01393 #endif
01394 
01395 #if !defined(AO_HAVE_int_fetch_and_add_release_write) && \
01396     defined(AO_HAVE_int_fetch_and_add_write)
01397 #  define AO_int_fetch_and_add_release_write(addr, val) \
01398         AO_int_fetch_and_add_write(addr, val)
01399 #  define AO_HAVE_int_fetch_and_add_release_write
01400 #endif
01401 #if !defined(AO_HAVE_int_fetch_and_add_release_write) && \
01402     defined(AO_HAVE_int_fetch_and_add_release)
01403 #  define AO_int_fetch_and_add_release_write(addr, val) \
01404         AO_int_fetch_and_add_release(addr, val)
01405 #  define AO_HAVE_int_fetch_and_add_release_write
01406 #endif
01407 #if !defined(AO_HAVE_int_fetch_and_add_acquire_read) && \
01408     defined(AO_HAVE_int_fetch_and_add_read)
01409 #  define AO_int_fetch_and_add_acquire_read(addr, val) \
01410         AO_int_fetch_and_add_read(addr, val)
01411 #  define AO_HAVE_int_fetch_and_add_acquire_read
01412 #endif
01413 #if !defined(AO_HAVE_int_fetch_and_add_acquire_read) && \
01414     defined(AO_HAVE_int_fetch_and_add_acquire)
01415 #  define AO_int_fetch_and_add_acquire_read(addr, val) \
01416         AO_int_fetch_and_add_acquire(addr, val)
01417 #  define AO_HAVE_int_fetch_and_add_acquire_read
01418 #endif
01419 
01420 #ifdef AO_NO_DD_ORDERING
01421 #  if defined(AO_HAVE_int_fetch_and_add_acquire_read)
01422 #    define AO_int_fetch_and_add_dd_acquire_read(addr, val) \
01423         AO_int_fetch_and_add_acquire_read(addr, val)
01424 #    define AO_HAVE_int_fetch_and_add_dd_acquire_read
01425 #  endif
01426 #else
01427 #  if defined(AO_HAVE_int_fetch_and_add)
01428 #    define AO_int_fetch_and_add_dd_acquire_read(addr, val) \
01429         AO_int_fetch_and_add(addr, val)
01430 #    define AO_HAVE_int_fetch_and_add_dd_acquire_read
01431 #  endif
01432 #endif
01433 
01434 /* int_fetch_and_add1 */
01435 
01436 #if defined(AO_HAVE_int_fetch_and_add_full) &&\
01437     !defined(AO_HAVE_int_fetch_and_add1_full)
01438 #  define AO_int_fetch_and_add1_full(addr) \
01439         AO_int_fetch_and_add_full(addr,1)
01440 #  define AO_HAVE_int_fetch_and_add1_full
01441 #endif
01442 #if defined(AO_HAVE_int_fetch_and_add_release) &&\
01443     !defined(AO_HAVE_int_fetch_and_add1_release)
01444 #  define AO_int_fetch_and_add1_release(addr) \
01445         AO_int_fetch_and_add_release(addr,1)
01446 #  define AO_HAVE_int_fetch_and_add1_release
01447 #endif
01448 #if defined(AO_HAVE_int_fetch_and_add_acquire) &&\
01449     !defined(AO_HAVE_int_fetch_and_add1_acquire)
01450 #  define AO_int_fetch_and_add1_acquire(addr) \
01451         AO_int_fetch_and_add_acquire(addr,1)
01452 #  define AO_HAVE_int_fetch_and_add1_acquire
01453 #endif
01454 #if defined(AO_HAVE_int_fetch_and_add_write) &&\
01455     !defined(AO_HAVE_int_fetch_and_add1_write)
01456 #  define AO_int_fetch_and_add1_write(addr) \
01457         AO_int_fetch_and_add_write(addr,1)
01458 #  define AO_HAVE_int_fetch_and_add1_write
01459 #endif
01460 #if defined(AO_HAVE_int_fetch_and_add_read) &&\
01461     !defined(AO_HAVE_int_fetch_and_add1_read)
01462 #  define AO_int_fetch_and_add1_read(addr) \
01463         AO_int_fetch_and_add_read(addr,1)
01464 #  define AO_HAVE_int_fetch_and_add1_read
01465 #endif
01466 #if defined(AO_HAVE_int_fetch_and_add_release_write) &&\
01467     !defined(AO_HAVE_int_fetch_and_add1_release_write)
01468 #  define AO_int_fetch_and_add1_release_write(addr) \
01469         AO_int_fetch_and_add_release_write(addr,1)
01470 #  define AO_HAVE_int_fetch_and_add1_release_write
01471 #endif
01472 #if defined(AO_HAVE_int_fetch_and_add_acquire_read) &&\
01473     !defined(AO_HAVE_int_fetch_and_add1_acquire_read)
01474 #  define AO_int_fetch_and_add1_acquire_read(addr) \
01475         AO_int_fetch_and_add_acquire_read(addr,1)
01476 #  define AO_HAVE_int_fetch_and_add1_acquire_read
01477 #endif
01478 #if defined(AO_HAVE_int_fetch_and_add) &&\
01479     !defined(AO_HAVE_int_fetch_and_add1)
01480 #  define AO_int_fetch_and_add1(addr) \
01481         AO_int_fetch_and_add(addr,1)
01482 #  define AO_HAVE_int_fetch_and_add1
01483 #endif
01484 
01485 #if defined(AO_HAVE_int_fetch_and_add1_full)
01486 #  if !defined(AO_HAVE_int_fetch_and_add1_release)
01487 #    define AO_int_fetch_and_add1_release(addr) \
01488          AO_int_fetch_and_add1_full(addr)
01489 #    define AO_HAVE_int_fetch_and_add1_release
01490 #  endif
01491 #  if !defined(AO_HAVE_int_fetch_and_add1_acquire)
01492 #    define AO_int_fetch_and_add1_acquire(addr) \
01493          AO_int_fetch_and_add1_full(addr)
01494 #    define AO_HAVE_int_fetch_and_add1_acquire
01495 #  endif
01496 #  if !defined(AO_HAVE_int_fetch_and_add1_write)
01497 #    define AO_int_fetch_and_add1_write(addr) \
01498          AO_int_fetch_and_add1_full(addr)
01499 #    define AO_HAVE_int_fetch_and_add1_write
01500 #  endif
01501 #  if !defined(AO_HAVE_int_fetch_and_add1_read)
01502 #    define AO_int_fetch_and_add1_read(addr) \
01503          AO_int_fetch_and_add1_full(addr)
01504 #    define AO_HAVE_int_fetch_and_add1_read
01505 #  endif
01506 #endif /* AO_HAVE_int_fetch_and_add1_full */
01507 
01508 #if !defined(AO_HAVE_int_fetch_and_add1) && \
01509     defined(AO_HAVE_int_fetch_and_add1_release)
01510 #  define AO_int_fetch_and_add1(addr) \
01511         AO_int_fetch_and_add1_release(addr)
01512 #  define AO_HAVE_int_fetch_and_add1
01513 #endif
01514 #if !defined(AO_HAVE_int_fetch_and_add1) && \
01515     defined(AO_HAVE_int_fetch_and_add1_acquire)
01516 #  define AO_int_fetch_and_add1(addr) \
01517         AO_int_fetch_and_add1_acquire(addr)
01518 #  define AO_HAVE_int_fetch_and_add1
01519 #endif
01520 #if !defined(AO_HAVE_int_fetch_and_add1) && \
01521     defined(AO_HAVE_int_fetch_and_add1_write)
01522 #  define AO_int_fetch_and_add1(addr) \
01523         AO_int_fetch_and_add1_write(addr)
01524 #  define AO_HAVE_int_fetch_and_add1
01525 #endif
01526 #if !defined(AO_HAVE_int_fetch_and_add1) && \
01527     defined(AO_HAVE_int_fetch_and_add1_read)
01528 #  define AO_int_fetch_and_add1(addr) \
01529         AO_int_fetch_and_add1_read(addr)
01530 #  define AO_HAVE_int_fetch_and_add1
01531 #endif
01532 
01533 #if defined(AO_HAVE_int_fetch_and_add1_acquire) &&\
01534     defined(AO_HAVE_nop_full) && \
01535     !defined(AO_HAVE_int_fetch_and_add1_full)
01536 #  define AO_int_fetch_and_add1_full(addr) \
01537         (AO_nop_full(), AO_int_fetch_and_add1_acquire(addr))
01538 #  define AO_HAVE_int_fetch_and_add1_full
01539 #endif
01540 
01541 #if !defined(AO_HAVE_int_fetch_and_add1_release_write) && \
01542     defined(AO_HAVE_int_fetch_and_add1_write)
01543 #  define AO_int_fetch_and_add1_release_write(addr) \
01544         AO_int_fetch_and_add1_write(addr)
01545 #  define AO_HAVE_int_fetch_and_add1_release_write
01546 #endif
01547 #if !defined(AO_HAVE_int_fetch_and_add1_release_write) && \
01548     defined(AO_HAVE_int_fetch_and_add1_release)
01549 #  define AO_int_fetch_and_add1_release_write(addr) \
01550         AO_int_fetch_and_add1_release(addr)
01551 #  define AO_HAVE_int_fetch_and_add1_release_write
01552 #endif
01553 #if !defined(AO_HAVE_int_fetch_and_add1_acquire_read) && \
01554     defined(AO_HAVE_int_fetch_and_add1_read)
01555 #  define AO_int_fetch_and_add1_acquire_read(addr) \
01556         AO_int_fetch_and_add1_read(addr)
01557 #  define AO_HAVE_int_fetch_and_add1_acquire_read
01558 #endif
01559 #if !defined(AO_HAVE_int_fetch_and_add1_acquire_read) && \
01560     defined(AO_HAVE_int_fetch_and_add1_acquire)
01561 #  define AO_int_fetch_and_add1_acquire_read(addr) \
01562         AO_int_fetch_and_add1_acquire(addr)
01563 #  define AO_HAVE_int_fetch_and_add1_acquire_read
01564 #endif
01565 
01566 #ifdef AO_NO_DD_ORDERING
01567 #  if defined(AO_HAVE_int_fetch_and_add1_acquire_read)
01568 #    define AO_int_fetch_and_add1_dd_acquire_read(addr) \
01569         AO_int_fetch_and_add1_acquire_read(addr)
01570 #    define AO_HAVE_int_fetch_and_add1_dd_acquire_read
01571 #  endif
01572 #else
01573 #  if defined(AO_HAVE_int_fetch_and_add1)
01574 #    define AO_int_fetch_and_add1_dd_acquire_read(addr) \
01575         AO_int_fetch_and_add1(addr)
01576 #    define AO_HAVE_int_fetch_and_add1_dd_acquire_read
01577 #  endif
01578 #endif
01579 
01580 /* int_fetch_and_sub1 */
01581 
01582 #if defined(AO_HAVE_int_fetch_and_add_full) &&\
01583     !defined(AO_HAVE_int_fetch_and_sub1_full)
01584 #  define AO_int_fetch_and_sub1_full(addr) \
01585         AO_int_fetch_and_add_full(addr,(unsigned int)(-1))
01586 #  define AO_HAVE_int_fetch_and_sub1_full
01587 #endif
01588 #if defined(AO_HAVE_int_fetch_and_add_release) &&\
01589     !defined(AO_HAVE_int_fetch_and_sub1_release)
01590 #  define AO_int_fetch_and_sub1_release(addr) \
01591         AO_int_fetch_and_add_release(addr,(unsigned int)(-1))
01592 #  define AO_HAVE_int_fetch_and_sub1_release
01593 #endif
01594 #if defined(AO_HAVE_int_fetch_and_add_acquire) &&\
01595     !defined(AO_HAVE_int_fetch_and_sub1_acquire)
01596 #  define AO_int_fetch_and_sub1_acquire(addr) \
01597         AO_int_fetch_and_add_acquire(addr,(unsigned int)(-1))
01598 #  define AO_HAVE_int_fetch_and_sub1_acquire
01599 #endif
01600 #if defined(AO_HAVE_int_fetch_and_add_write) &&\
01601     !defined(AO_HAVE_int_fetch_and_sub1_write)
01602 #  define AO_int_fetch_and_sub1_write(addr) \
01603         AO_int_fetch_and_add_write(addr,(unsigned int)(-1))
01604 #  define AO_HAVE_int_fetch_and_sub1_write
01605 #endif
01606 #if defined(AO_HAVE_int_fetch_and_add_read) &&\
01607     !defined(AO_HAVE_int_fetch_and_sub1_read)
01608 #  define AO_int_fetch_and_sub1_read(addr) \
01609         AO_int_fetch_and_add_read(addr,(unsigned int)(-1))
01610 #  define AO_HAVE_int_fetch_and_sub1_read
01611 #endif
01612 #if defined(AO_HAVE_int_fetch_and_add_release_write) &&\
01613     !defined(AO_HAVE_int_fetch_and_sub1_release_write)
01614 #  define AO_int_fetch_and_sub1_release_write(addr) \
01615         AO_int_fetch_and_add_release_write(addr,(unsigned int)(-1))
01616 #  define AO_HAVE_int_fetch_and_sub1_release_write
01617 #endif
01618 #if defined(AO_HAVE_int_fetch_and_add_acquire_read) &&\
01619     !defined(AO_HAVE_int_fetch_and_sub1_acquire_read)
01620 #  define AO_int_fetch_and_sub1_acquire_read(addr) \
01621         AO_int_fetch_and_add_acquire_read(addr,(unsigned int)(-1))
01622 #  define AO_HAVE_int_fetch_and_sub1_acquire_read
01623 #endif
01624 #if defined(AO_HAVE_int_fetch_and_add) &&\
01625     !defined(AO_HAVE_int_fetch_and_sub1)
01626 #  define AO_int_fetch_and_sub1(addr) \
01627         AO_int_fetch_and_add(addr,(unsigned int)(-1))
01628 #  define AO_HAVE_int_fetch_and_sub1
01629 #endif
01630 
01631 #if defined(AO_HAVE_int_fetch_and_sub1_full)
01632 #  if !defined(AO_HAVE_int_fetch_and_sub1_release)
01633 #    define AO_int_fetch_and_sub1_release(addr) \
01634          AO_int_fetch_and_sub1_full(addr)
01635 #    define AO_HAVE_int_fetch_and_sub1_release
01636 #  endif
01637 #  if !defined(AO_HAVE_int_fetch_and_sub1_acquire)
01638 #    define AO_int_fetch_and_sub1_acquire(addr) \
01639          AO_int_fetch_and_sub1_full(addr)
01640 #    define AO_HAVE_int_fetch_and_sub1_acquire
01641 #  endif
01642 #  if !defined(AO_HAVE_int_fetch_and_sub1_write)
01643 #    define AO_int_fetch_and_sub1_write(addr) \
01644          AO_int_fetch_and_sub1_full(addr)
01645 #    define AO_HAVE_int_fetch_and_sub1_write
01646 #  endif
01647 #  if !defined(AO_HAVE_int_fetch_and_sub1_read)
01648 #    define AO_int_fetch_and_sub1_read(addr) \
01649          AO_int_fetch_and_sub1_full(addr)
01650 #    define AO_HAVE_int_fetch_and_sub1_read
01651 #  endif
01652 #endif /* AO_HAVE_int_fetch_and_sub1_full */
01653 
01654 #if !defined(AO_HAVE_int_fetch_and_sub1) && \
01655     defined(AO_HAVE_int_fetch_and_sub1_release)
01656 #  define AO_int_fetch_and_sub1(addr) \
01657         AO_int_fetch_and_sub1_release(addr)
01658 #  define AO_HAVE_int_fetch_and_sub1
01659 #endif
01660 #if !defined(AO_HAVE_int_fetch_and_sub1) && \
01661     defined(AO_HAVE_int_fetch_and_sub1_acquire)
01662 #  define AO_int_fetch_and_sub1(addr) \
01663         AO_int_fetch_and_sub1_acquire(addr)
01664 #  define AO_HAVE_int_fetch_and_sub1
01665 #endif
01666 #if !defined(AO_HAVE_int_fetch_and_sub1) && \
01667     defined(AO_HAVE_int_fetch_and_sub1_write)
01668 #  define AO_int_fetch_and_sub1(addr) \
01669         AO_int_fetch_and_sub1_write(addr)
01670 #  define AO_HAVE_int_fetch_and_sub1
01671 #endif
01672 #if !defined(AO_HAVE_int_fetch_and_sub1) && \
01673     defined(AO_HAVE_int_fetch_and_sub1_read)
01674 #  define AO_int_fetch_and_sub1(addr) \
01675         AO_int_fetch_and_sub1_read(addr)
01676 #  define AO_HAVE_int_fetch_and_sub1
01677 #endif
01678 
01679 #if defined(AO_HAVE_int_fetch_and_sub1_acquire) &&\
01680     defined(AO_HAVE_nop_full) && \
01681     !defined(AO_HAVE_int_fetch_and_sub1_full)
01682 #  define AO_int_fetch_and_sub1_full(addr) \
01683         (AO_nop_full(), AO_int_fetch_and_sub1_acquire(addr))
01684 #  define AO_HAVE_int_fetch_and_sub1_full
01685 #endif
01686 
01687 #if !defined(AO_HAVE_int_fetch_and_sub1_release_write) && \
01688     defined(AO_HAVE_int_fetch_and_sub1_write)
01689 #  define AO_int_fetch_and_sub1_release_write(addr) \
01690         AO_int_fetch_and_sub1_write(addr)
01691 #  define AO_HAVE_int_fetch_and_sub1_release_write
01692 #endif
01693 #if !defined(AO_HAVE_int_fetch_and_sub1_release_write) && \
01694     defined(AO_HAVE_int_fetch_and_sub1_release)
01695 #  define AO_int_fetch_and_sub1_release_write(addr) \
01696         AO_int_fetch_and_sub1_release(addr)
01697 #  define AO_HAVE_int_fetch_and_sub1_release_write
01698 #endif
01699 #if !defined(AO_HAVE_int_fetch_and_sub1_acquire_read) && \
01700     defined(AO_HAVE_int_fetch_and_sub1_read)
01701 #  define AO_int_fetch_and_sub1_acquire_read(addr) \
01702         AO_int_fetch_and_sub1_read(addr)
01703 #  define AO_HAVE_int_fetch_and_sub1_acquire_read
01704 #endif
01705 #if !defined(AO_HAVE_int_fetch_and_sub1_acquire_read) && \
01706     defined(AO_HAVE_int_fetch_and_sub1_acquire)
01707 #  define AO_int_fetch_and_sub1_acquire_read(addr) \
01708         AO_int_fetch_and_sub1_acquire(addr)
01709 #  define AO_HAVE_int_fetch_and_sub1_acquire_read
01710 #endif
01711 
01712 #ifdef AO_NO_DD_ORDERING
01713 #  if defined(AO_HAVE_int_fetch_and_sub1_acquire_read)
01714 #    define AO_int_fetch_and_sub1_dd_acquire_read(addr) \
01715         AO_int_fetch_and_sub1_acquire_read(addr)
01716 #    define AO_HAVE_int_fetch_and_sub1_dd_acquire_read
01717 #  endif
01718 #else
01719 #  if defined(AO_HAVE_int_fetch_and_sub1)
01720 #    define AO_int_fetch_and_sub1_dd_acquire_read(addr) \
01721         AO_int_fetch_and_sub1(addr)
01722 #    define AO_HAVE_int_fetch_and_sub1_dd_acquire_read
01723 #  endif
01724 #endif

Generated on Sat Apr 23 11:43:34 2011 for Mnemosyne by  doxygen 1.4.7