-#define PAGE_MASK (~(PAGE_SIZE - 1))
-#define __ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask))
-#define ALIGN(v, align) __ALIGN_MASK(v, (__typeof__(v)) (align) - 1)
-#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
+
+/*
+ * Align value to the next multiple of align. Returns val if it already is a
+ * multiple of align. Align must be a power of two.
+ */
+#define __lttng_align_ceil_mask(v, mask) (((v) + (mask)) & ~(mask))
+
+#define lttng_align_ceil(v, align) \
+ __lttng_align_ceil_mask(v, (__typeof__(v)) (align) - 1)
+
+/*
+ * Align value to the previous multiple of align. Returns val if it already is a
+ * multiple of align. Align must be a power of two.
+ */
+#define __lttng_align_floor_mask(v, mask) ((v) & ~(mask))
+
+#define lttng_align_floor(v, align) \
+ __lttng_align_floor_mask(v, (__typeof__(v)) (align) - 1)