X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Fust%2Fcore.h;h=eee405dd4c27a46d743eecb625daaed5c144f065;hb=2874fee50444405591974a7166313063b315efe1;hp=0172614331dfd4ae70bfe339c9447f75500ed33f;hpb=066b83b8dfc562e00cb61d39eca0e0f77242828c;p=ust.git diff --git a/include/ust/core.h b/include/ust/core.h index 0172614..eee405d 100644 --- a/include/ust/core.h +++ b/include/ust/core.h @@ -19,46 +19,11 @@ #define UST_CORE_H #include +#include #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) -#if defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT) - -/* - * Calculate the offset needed to align the type. - * size_of_type must be non-zero. - */ -static inline unsigned int ltt_align(size_t align_drift, size_t size_of_type) -{ - size_t alignment = min(sizeof(void *), size_of_type); - return (alignment - align_drift) & (alignment - 1); -} -/* Default arch alignment */ -#define LTT_ALIGN - -static inline int ltt_get_alignment(void) -{ - return sizeof(void *); -} - -#else - -static inline unsigned int ltt_align(size_t align_drift, - size_t size_of_type) -{ - return 0; -} - -#define LTT_ALIGN __attribute__((packed)) - -static inline int ltt_get_alignment(void) -{ - return 0; -} -#endif /* defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT) */ - - /* ARRAYS */ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) @@ -141,7 +106,7 @@ static __inline__ int get_count_order(unsigned int count) return order; } -#define container_of(ptr, type, member) ({ \ +#define _ust_container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );})