summaryrefslogtreecommitdiff
path: root/tools/perf/util/include/linux/kernel.h
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-16 13:30:09 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-16 13:30:09 +0300
commite7d9facf0bab6d919342fea17c8cc0f65f8a0fe9 (patch)
tree8301035b4dcb273c211c04fe2c0d1cbaf897021b /tools/perf/util/include/linux/kernel.h
parent28bcd199cc4465733c1ac0c70135a385fff97c71 (diff)
parentddffeb8c4d0331609ef2581d84de4d763607bd37 (diff)
Merge tag 'v3.7-rc1'
Merge Linux 3.7-rc1 to get latest upstream changes.
Diffstat (limited to 'tools/perf/util/include/linux/kernel.h')
-rw-r--r--tools/perf/util/include/linux/kernel.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h
index b6842c1d02a8..d8c927c868ee 100644
--- a/tools/perf/util/include/linux/kernel.h
+++ b/tools/perf/util/include/linux/kernel.h
@@ -8,8 +8,8 @@
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+#define PERF_ALIGN(x, a) __PERF_ALIGN_MASK(x, (typeof(x))(a)-1)
+#define __PERF_ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
@@ -46,9 +46,22 @@
_min1 < _min2 ? _min1 : _min2; })
#endif
+#ifndef roundup
+#define roundup(x, y) ( \
+{ \
+ const typeof(y) __y = y; \
+ (((x) + (__y - 1)) / __y) * __y; \
+} \
+)
+#endif
+
#ifndef BUG_ON
+#ifdef NDEBUG
+#define BUG_ON(cond) do { if (cond) {} } while (0)
+#else
#define BUG_ON(cond) assert(!(cond))
#endif
+#endif
/*
* Both need more care to handle endianness