Commit bc53d03f authored by Giulio Moro's avatar Giulio Moro Committed by Jan Kiszka

Rename __clz to xenomai_count_leading_zeros

This is to avoid namespace conflicts (e.g.: with Clang's arm_acle.h)
Signed-off-by: 's avatarGiulio Moro <giuliomoro@yahoo.it>
[Jan: back-ported to 3.0.x]
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent a2586238
......@@ -83,7 +83,7 @@ void __invalid_operand_size(void);
__ret; \
})
#define __clz(__v) \
#define xenomai_count_leading_zeros(__v) \
({ \
int __ret; \
if (!__v) \
......
......@@ -439,7 +439,8 @@ static void *alloc_block(struct shared_heap *heap, size_t size)
*/
if (size <= HOBJ_PAGE_SIZE * 2) {
/* Find log2(size). */
log2size = sizeof(size) * 8 - 1 - __clz(size);
log2size = sizeof(size) * 8 - 1 -
xenomai_count_leading_zeros(size);
if (size & (size - 1))
log2size++;
/* That is the actual block size we need. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment