#define UST_CORE_H
#include <sys/types.h>
+#include <ust/config.h>
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
-#if defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT)
+#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
/*
* Calculate the offset needed to align the type.
return sizeof(void *);
}
-#else
+#else /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
static inline unsigned int ltt_align(size_t align_drift,
size_t size_of_type)
{
return 0;
}
-#endif /* defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT) */
+#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
/* ARRAYS */
#define DEFINE_MUTEX(m) pthread_mutex_t (m) = PTHREAD_MUTEX_INITIALIZER;
#define DECLARE_MUTEX(m) extern pthread_mutex_t (m);
-#define mutex_lock(m) pthread_mutex_lock(m)
-
-#define mutex_unlock(m) pthread_mutex_unlock(m)
-
-
/* MALLOCATION */
#define zmalloc(s) calloc(1, s)
-/* ATTRIBUTES */
-
-/* FIXME: define this */
-#define ____cacheline_aligned
-
/* MATH */
#include <ust/processor.h>
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) );})