diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c772520d5..b0d0fc1e9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,12 +87,6 @@ if(KernelArchRiscV) endif() endif() string(APPEND common_flags " ${build_arch}") -if(Kernel64) - string(APPEND common_flags " -D__KERNEL_64__") -else() - string(APPEND common_flags " -D__KERNEL_32__") -endif() - set( BASE_ASM_FLAGS "${asm_common_flags} ${common_flags}" CACHE INTERNAL "Default ASM flags for compilation \ diff --git a/include/fastpath/fastpath.h b/include/fastpath/fastpath.h index 252c42f910..eb99885171 100644 --- a/include/fastpath/fastpath.h +++ b/include/fastpath/fastpath.h @@ -68,14 +68,16 @@ static inline void thread_state_ptr_mset_blockingObject_tsType(thread_state_t *t static inline void cap_reply_cap_ptr_new_np(cap_t *cap_ptr, word_t capReplyCanGrant, word_t capReplyMaster, word_t capTCBPtr) { -#ifdef __KERNEL_64__ +#if CONFIG_WORD_SIZE == 64 cap_ptr->words[1] = (word_t)capTCBPtr; cap_ptr->words[0] = (capReplyMaster) | (capReplyCanGrant << 1) | ((word_t)cap_reply_cap << 59); -#else +#elif CONFIG_WORD_SIZE == 32 cap_ptr->words[0] = TCB_REF(capTCBPtr) | (capReplyMaster << 4) | (capReplyCanGrant << 5) | cap_reply_cap ; -#endif +#else +#error invalid CONFIG_WORD_SIZE +#endif /* CONFIG_WORD_SIZE */ } #endif