diff options
author | Andy Fleming <afleming@freescale.com> | 2008-06-16 13:58:53 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-06-28 22:20:29 +0200 |
commit | 4b03ac8b5102ad95f9fede7d13fa236977593e7d (patch) | |
tree | e1011fcdfa951ca465539e12fb5c12b3dd2586ce | |
parent | 28eab0d77352b84885f938759bf2612b7bf0bc44 (diff) | |
download | u-boot-imx-4b03ac8b5102ad95f9fede7d13fa236977593e7d.zip u-boot-imx-4b03ac8b5102ad95f9fede7d13fa236977593e7d.tar.gz u-boot-imx-4b03ac8b5102ad95f9fede7d13fa236977593e7d.tar.bz2 |
Add ALIGN() macro
ALIGN() returns the smallest aligned value greater than the passed
in address or size. Taken from Linux.
Signed-off-by: Andy Fleming <afleming@freescale.com>
-rw-r--r-- | include/common.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h index fd5adb3..3190781 100644 --- a/include/common.h +++ b/include/common.h @@ -682,6 +682,9 @@ void __attribute__((weak)) show_boot_progress (int val); #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) +#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1) +#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) + /* Multicore arch functions */ #ifdef CONFIG_MP int cpu_status(int nr); |