summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-02-18 15:16:35 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-19 08:54:09 +0100
commita876d16e6ad3736d01dd3d1d2e956c79cc9d9881 (patch)
tree3f304a21bc6adb8356875489932e11d68f24a29e
parent10191923f1197b5922d07fbf5f8b1929245bd825 (diff)
downloadbarebox-a876d16e6ad3736d01dd3d1d2e956c79cc9d9881.tar.gz
barebox-a876d16e6ad3736d01dd3d1d2e956c79cc9d9881.tar.xz
scripts: define ALIGN(x) in scripts' <linux/kernel.h>
To make code sharing between utilities in scripts/ and barebox easier, define ALIGN in the scripts/include/linux/kernel.h as well for compatibility with the barebox include/linux/kernel.h. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--scripts/include/linux/kernel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/include/linux/kernel.h b/scripts/include/linux/kernel.h
index 5d94e984f1..dc2e64e164 100644
--- a/scripts/include/linux/kernel.h
+++ b/scripts/include/linux/kernel.h
@@ -6,6 +6,8 @@
#include <stdlib.h>
#include <assert.h>
+#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
+#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1)
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))