diff --git a/camkes/templates/component.simple.c b/camkes/templates/component.simple.c index 574babf4..66fd0132 100644 --- a/camkes/templates/component.simple.c +++ b/camkes/templates/component.simple.c @@ -482,7 +482,13 @@ void camkes_make_simple(simple_t *simple) { /*# If there is no size specified in the configuration then we assume the cnode will be as small as possible to hold all the capabilities that are currently defined #*/ - simple_data.cnodesizebits = CONFIG_WORD_SIZE - __builtin_clz(/*? holding_slot ?*/) + 1; +#if CONFIG_WORD_SIZE == 32 + simple_data.cnodesizebits = CONFIG_WORD_SIZE - __builtin_clzl(/*? holding_slot ?*/) + 1; +#elif CONFIG_WORD_SIZE == 64 + simple_data.cnodesizebits = CONFIG_WORD_SIZE - __builtin_clzll(/*? holding_slot ?*/) + 1; +#else + #error "Unknown kernel word size" +#endif /*- endif -*/ /*# Find untyped physical addresses. We only care if the untyped is at least a page size #*/ /*- for u in untyped_obj_list -*/