Extend align.h
[lttng-ust.git] / include / lttng / core.h
index 7977be4dad2c64d53624cbf215158008a8c2807d..838cdb20c7aa50dbaa1b971998cc5e67bb3abfaa 100644 (file)
 #include <urcu/arch.h>
 #include <urcu/compiler.h>
 
-/* ALIGNMENT SHORTCUTS */
-
-#include <unistd.h>
-
-#define ALIGN(x,a)             __ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask)   (((x)+(mask))&~(mask))
-#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
-#define PAGE_MASK (~(PAGE_SIZE-1))
-
-/* ERROR OPS */
-#define MAX_ERRNO      4095
-
-#define IS_ERR_VALUE(x) caa_unlikely((x) >= (unsigned long)-MAX_ERRNO)
-
-static inline void *ERR_PTR(long error)
-{
-       return (void *) error;
-}
-
-static inline long PTR_ERR(const void *ptr)
-{
-       return (long) ptr;
-}
-
-static inline long IS_ERR(const void *ptr)
-{
-       return IS_ERR_VALUE((unsigned long)ptr);
-}
-
-
 /* Min / Max */
 
 #define min_t(type, x, y) ({                    \
@@ -79,18 +48,6 @@ void *zmalloc(size_t len)
        return calloc(1, len);
 }
 
-static inline
-void *malloc_align(size_t len)
-{
-       return malloc(ALIGN(len, CAA_CACHE_LINE_SIZE));
-}
-
-static inline
-void *zmalloc_align(size_t len)
-{
-       return calloc(1, ALIGN(len, CAA_CACHE_LINE_SIZE));
-}
-
 /* MATH */
 
 static inline unsigned int hweight32(unsigned int w)
This page took 0.026669 seconds and 4 git commands to generate.