mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
linux/kernel.h: Add ALIGN_DOWN macro
Follow Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
e7dd4f9b0c
commit
75db00eea0
1 changed files with 1 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
||||||
#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
|
#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
|
||||||
|
|
||||||
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
|
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
|
||||||
|
#define ALIGN_DOWN(x, a) ALIGN((x) - ((a) - 1), (a))
|
||||||
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
|
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
|
||||||
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
|
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
|
||||||
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
|
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
|
||||||
|
|
Loading…
Reference in a new issue