aboutsummaryrefslogtreecommitdiff
path: root/tools/imagetool.h
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2020-03-30 11:56:17 +0800
committerTom Rini <trini@konsulko.com>2020-04-24 10:10:00 -0400
commitc738adb8dbbf28a34f8574239a241e85d46f3877 (patch)
treef16bc06c077bda0a20db03571e23c053d9a95363 /tools/imagetool.h
parent9b544c9eb312741e8e27bb738329bcf2737168ad (diff)
downloadu-boot-c738adb8dbbf28a34f8574239a241e85d46f3877.zip
u-boot-c738adb8dbbf28a34f8574239a241e85d46f3877.tar.gz
u-boot-c738adb8dbbf28a34f8574239a241e85d46f3877.tar.bz2
tool: Move ALIGN_MASK to header as common MACRO
The ALIGN code is need by many files who need handle structure or image align, so move the macro to imagetool.h file. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/imagetool.h')
-rw-r--r--tools/imagetool.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/imagetool.h b/tools/imagetool.h
index e1c778b..81e5cd0 100644
--- a/tools/imagetool.h
+++ b/tools/imagetool.h
@@ -25,6 +25,9 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
+#define ALIGN(x, a) __ALIGN_MASK((x), (typeof(x))(a) - 1)
+
#define IH_ARCH_DEFAULT IH_ARCH_INVALID
/* Information about a file that needs to be placed into the FIT */