Go to the documentation of this file. 24 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) 26 #if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || \ 27 defined(_ARCH_PPC64) || defined(__s390x__) || \ 28 (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8) 38 #define XRT_PRINTF_FORMAT(fmt, list) __attribute__((format(printf, fmt, list))) 40 #define XRT_PRINTF_FORMAT(fmt, list) 48 #define XRT_MAYBE_UNUSED __attribute__((unused)) 50 #define XRT_MAYBE_UNUSED 58 #define XRT_NO_INLINE __attribute__((noinline)) 70 #define XRT_DEBUGBREAK() 71 #elif defined(__clang__) || defined(__GNUC__) 72 #define XRT_DEBUGBREAK() __builtin_trap() 73 #elif defined(_MSC_VER) 75 #define XRT_DEBUGBREAK() __debugbreak() 77 #error "compiler not supported" 83 #define xrt_atomic_inc_return(v) __sync_add_and_fetch((v), 1) 84 #define xrt_atomic_dec_return(v) __sync_sub_and_fetch((v), 1) 85 #define xrt_atomic_cmpxchg(v, old, _new) \ 86 __sync_val_compare_and_swap((v), (old), (_new)) 88 #error "compiler not supported" 96 #define container_of(ptr, type, field) \ 97 (type *)((char *)ptr - offsetof(type, field))