Lines Matching defs:boundary
91 * The round_up() macro rounds up a value to the given boundary in a
92 * type-agnostic yet type-safe manner. The boundary must be a power of two.
93 * In other words, it computes the smallest multiple of boundary which is
98 #define round_boundary(value, boundary) \
99 ((__typeof__(value))((boundary) - 1))
101 #define round_up(value, boundary) \
102 ((((value) - 1) | round_boundary(value, boundary)) + 1)
104 #define round_down(value, boundary) \
105 ((value) & ~round_boundary(value, boundary))
143 * Helper macro to ensure a value lies on a given boundary.
145 #define is_aligned(value, boundary) \
146 (round_up((uintptr_t) value, boundary) == \
147 round_down((uintptr_t) value, boundary))