diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2020-03-30 06:56:17 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-04-24 17:10:00 +0300 |
commit | c738adb8dbbf28a34f8574239a241e85d46f3877 (patch) | |
tree | f16bc06c077bda0a20db03571e23c053d9a95363 /tools/imagetool.h | |
parent | 9b544c9eb312741e8e27bb738329bcf2737168ad (diff) | |
download | u-boot-c738adb8dbbf28a34f8574239a241e85d46f3877.tar.xz |
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.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/imagetool.h b/tools/imagetool.h index e1c778b0df..81e5cd0c5c 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 */ |