Lines Matching refs:boundary
133 * The round_up() macro rounds up a value to the given boundary in a
134 * type-agnostic yet type-safe manner. The boundary must be a power of two.
135 * In other words, it computes the smallest multiple of boundary which is
140 #define round_boundary(value, boundary) \
141 ((__typeof__(value))((boundary) - ((__typeof__(value))1U)))
143 #define round_up(value, boundary) \
144 ((((value) - ((__typeof__(value))1U)) | round_boundary(value, boundary)) + ((__typeof__(value))1U))
146 #define round_down(value, boundary) \
147 ((value) & ~round_boundary(value, boundary))
185 * Helper macro to ensure a value lies on a given boundary.
187 #define is_aligned(value, boundary) \
188 (round_up((uintptr_t) value, boundary) == \
189 round_down((uintptr_t) value, boundary))