mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
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>
This commit is contained in:
@@ -8,15 +8,13 @@
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <getopt.h>
|
||||
#include "imagetool.h"
|
||||
#include "os_support.h"
|
||||
|
||||
#ifndef __packed
|
||||
#define __packed __attribute__((packed))
|
||||
#endif
|
||||
#define KiB 1024
|
||||
#define ALIGN(x, a) __ALIGN_MASK((x), (typeof(x))(a) - 1)
|
||||
#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
/*
|
||||
* min()/max()/clamp() macros that also do
|
||||
|
Reference in New Issue
Block a user