1*b4dd7d09SAndy Fiddaman/* : : generated from contrib/ast/src/lib/libast/features/aso by iffe version 2012-07-17 : : */ 2*b4dd7d09SAndy Fiddaman#ifndef _def_aso_ast 3*b4dd7d09SAndy Fiddaman#define _def_aso_ast 1 4*b4dd7d09SAndy Fiddaman#define _sys_types 1 /* #include <sys/types.h> ok */ 5*b4dd7d09SAndy Fiddaman/* <atomic.h> atomic_cas_64 */ 6*b4dd7d09SAndy Fiddaman#include <atomic.h> 7*b4dd7d09SAndy Fiddaman#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) 8*b4dd7d09SAndy Fiddaman#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) 9*b4dd7d09SAndy Fiddaman#define _aso_dec8(p) (atomic_add_8_nv(p,-1)+1) 10*b4dd7d09SAndy Fiddaman#define _aso_cas16(p,o,n) atomic_cas_16(p,o,n) 11*b4dd7d09SAndy Fiddaman#define _aso_inc16(p) (atomic_add_16_nv(p,1)-1) 12*b4dd7d09SAndy Fiddaman#define _aso_dec16(p) (atomic_add_16_nv(p,-1)+1) 13*b4dd7d09SAndy Fiddaman#define _aso_cas32(p,o,n) atomic_cas_32(p,o,n) 14*b4dd7d09SAndy Fiddaman#define _aso_inc32(p) (atomic_add_32_nv(p,1)-1) 15*b4dd7d09SAndy Fiddaman#define _aso_dec32(p) (atomic_add_32_nv(p,-1)+1) 16*b4dd7d09SAndy Fiddaman#define _aso_cas64(p,o,n) atomic_cas_64(p,o,n) 17*b4dd7d09SAndy Fiddaman#define _aso_inc64(p) (atomic_add_64_nv(p,1)-1) 18*b4dd7d09SAndy Fiddaman#define _aso_dec64(p) (atomic_add_64_nv(p,-1)+1) 19*b4dd7d09SAndy Fiddaman#if _ast_sizeof_pointer == 8 20*b4dd7d09SAndy Fiddaman#define _aso_casptr(p,o,n) ((void*)atomic_cas_64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) 21*b4dd7d09SAndy Fiddaman#else 22*b4dd7d09SAndy Fiddaman#define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) 23*b4dd7d09SAndy Fiddaman#endif 24*b4dd7d09SAndy Fiddaman 25*b4dd7d09SAndy Fiddaman#endif 26