Add IS_ALIGNED(x, a) macro helper

Change-Id: Ic5799e4bc03cabddece80cbc129b16f3a19ff9c5
This commit is contained in:
Andrew Ryabinin 2014-11-29 20:42:22 +03:00
parent d924c83066
commit d1fcfe950a

View file

@ -134,6 +134,8 @@ int get_cpu_boost_counter(void);
(size) = __a2 > __a1 ? __a2 - __a1 : 0; \
})
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
#define PTR_ADD(ptr, x) ((typeof(ptr))((char*)(ptr) + (x)))
#define PTR_SUB(ptr, x) ((typeof(ptr))((char*)(ptr) - (x)))