+ *_out = (i * 8 + p); \
+ \
+ return true; \
+}
+
+#define _DEFINE_BMP_ALLOCFROM_OP(type, size, name, orient) \
+static inline bool \
+bitmap_##name##_alloc_between(BMP_PARAM(name), \
+ unsigned long start, unsigned long end, \
+ unsigned long* _out) \
+{ \
+ unsigned long i, p = 0; \
+ unsigned long i_e, p_e = 0; \
+ int shift; \
+ type u; \
+ \
+ i = start / 8 / sizeof(type); \
+ i_e = end / 8 / sizeof(type); \
+ p_e = end % (8 * sizeof(type)); \
+ shift = select(orient == BMP_ORIENT_MSB, sizeof(type) * 8 - 1, 0); \
+ \
+ while (i < i_e && (u = BMP_STRCUT_MAP[i]) == (type)-1) i++; \
+ while ((u & (type)(1U << shift)) && p++ < sizeof(type) * 8) \
+ select(orient == BMP_ORIENT_MSB, u <<= 1, u >>= 1); \
+ \
+ if (i >= i_e && p > p_e) \
+ return false; \
+ \
+ BMP_STRCUT_MAP[i] |= 1UL << shift; \
+ *_out = (i * 8 + p); \
+ \