From c738adb8dbbf28a34f8574239a241e85d46f3877 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Mon, 30 Mar 2020 11:56:17 +0800 Subject: 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 Reviewed-by: Punit Agrawal Reviewed-by: Tom Rini --- tools/imagetool.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/imagetool.h') 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 */ -- cgit v1.1