|
| #define | DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) |
| |
| #define | PERF_ALIGN(x, a) __PERF_ALIGN_MASK(x, (typeof(x))(a)-1) |
| |
| #define | __PERF_ALIGN_MASK(x, mask) (((x)+(mask))&~(mask)) |
| |
| #define | offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
| |
| #define | container_of(ptr, type, member) |
| |
| #define | BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) |
| |
| #define | max(x, y) |
| |
| #define | min(x, y) |
| |
| #define | roundup(x, y) |
| |
| #define | BUG_ON(cond) assert(!(cond)) |
| |
| #define | cpu_to_le64(x) (x) |
| |
| #define | cpu_to_le32(x) (x) |
| |
| #define | pr_fmt(fmt) fmt |
| |
| #define | pr_err(fmt,...) eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | pr_warning(fmt,...) eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | pr_info(fmt,...) eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | pr_debug(fmt,...) eprintf(1, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | pr_debugN(n, fmt,...) eprintf(n, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | pr_debug2(fmt,...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | pr_debug3(fmt,...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | pr_debug4(fmt,...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__) |
| |
| #define | __round_mask(x, y) ((__typeof__(x))((y)-1)) |
| |
| #define | round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) |
| |
| #define | round_down(x, y) ((x) & ~__round_mask(x, y)) |
| |