Tag: bitwise
-
TIL: ALIGN in Linux kernel
from include/uapi/linux/kernel.h and scripts/dtc/dtc.h #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))a – 1) #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) or #define ALIGN(x, a) (((x) + (a) – 1) & ~((a) – 1))