From 49686838a906e311967ccb79fd27f3ad30c7f157 Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Tue, 4 Jun 2013 01:13:49 +0200 Subject: common: add ALIGN_DOWN macro Signed-off-by: Alexander Aring Signed-off-by: Sascha Hauer --- include/common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 293ca49391..fc2c8ca8be 100644 --- a/include/common.h +++ b/include/common.h @@ -184,6 +184,7 @@ int run_shell(void); #define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1) #define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) +#define ALIGN_DOWN(x, a) ((x) & ~((typeof(x))(a) - 1)) #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) -- cgit v1.2.3