1 /* 2 * Copyright 2007, Hugo Santos. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _FBSD_COMPAT_MACHINE_ATOMIC_H_ 6 #define _FBSD_COMPAT_MACHINE_ATOMIC_H_ 7 8 9 #include <KernelExport.h> 10 11 12 #define atomic_add_int(ptr, value) \ 13 atomic_add((int32 *)(ptr), value) 14 15 #define atomic_subtract_int(ptr, value) \ 16 atomic_add((int32 *)(ptr), -value) 17 18 #define atomic_set_acq_32(ptr, value) \ 19 atomic_set_int(ptr, value) 20 21 #define atomic_set_int(ptr, value) \ 22 atomic_or((int32 *)(ptr), value) 23 24 #define atomic_readandclear_int(ptr) \ 25 atomic_set((int32 *)(ptr), 0) 26 27 #endif /* _FBSD_COMPAT_MACHINE_ATOMIC_H_ */ 28