10 #include "../../include/linux/compiler.h"
11 #include "../../../include/linux/kconfig.h"
14 #define RADIX_TREE_MAP_SHIFT 6
16 #define RADIX_TREE_MAP_SHIFT 3
23 #define BUG_ON(expr) assert(!(expr))
24 #define WARN_ON(expr) assert(!(expr))
30 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
31 #define pr_debug printk
33 #define smp_rmb() barrier()
34 #define smp_wmb() barrier()
35 #define cpu_relax() barrier()
37 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
39 #define container_of(ptr, type, member) ({ \
40 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
41 (type *)( (char *)__mptr - offsetof(type, member) );})
42 #define min(a, b) ((a) < (b) ? (a) : (b))
44 #define cond_resched() sched_yield()
46 static inline int in_interrupt(void)
52 * This looks more complex than it should be. But we need to
53 * get the type for the ~ right in round_down (it needs to be
54 * as wide as the result!), and we want to evaluate the macro
55 * arguments just once each.
57 #define __round_mask(x, y) ((__typeof__(x))((y)-1))
58 #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
59 #define round_down(x, y) ((x) & ~__round_mask(x, y))
61 #endif /* _KERNEL_H */