tool: Move ALIGN_MASK to header as common MACRO
[oweals/u-boot.git] / tools / imagetool.h
index e1c778b0dffd78542a3a32c294a83d6864b4255f..81e5cd0c5ccd1cc7236f4224f664ff73d195672a 100644 (file)
@@ -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 */