From a6e85b248ac6ff2452faaf0fdb10fd1db1040463 Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Thu, 6 Oct 2016 16:27:45 -0400 Subject: [PATCH] unified: fix remaining issues for building without SYS_CLOCK_EXIST Do not include timeout_q.h when !SYS_CLOCK_EXIST, this allows removing _unpend_thread_timing_out() in that case. Have _abort_thread_timeout() return 0 (success) when !SYS_CLOCK_EXIST. With this change, the minimal footprint nanokernel project compiles for the unified kernel. Change-Id: Ifbf9167a82fb3ebcf6941bf3f85c105c23c9060c Signed-off-by: Benjamin Walsh --- kernel/unified/include/timeout_q.h | 5 ----- kernel/unified/include/wait_q.h | 13 +++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/kernel/unified/include/timeout_q.h b/kernel/unified/include/timeout_q.h index 20a1686c7c0..31642f04370 100644 --- a/kernel/unified/include/timeout_q.h +++ b/kernel/unified/include/timeout_q.h @@ -29,7 +29,6 @@ extern "C" { #endif -#if defined(CONFIG_SYS_CLOCK_EXISTS) /* initialize the nano timeouts part of k_thread when enabled in the kernel */ static inline void _init_timeout(struct _timeout *t, _timeout_func_t func) @@ -91,10 +90,6 @@ static inline void _unpend_thread_timing_out(struct k_thread *thread, } } -#else -#define _unpend_thread_timing_out(thread, timeout_obj) do { } while (0) -#endif /* CONFIG_SYS_CLOCK_EXISTS */ - /* * Handle one expired timeout. * diff --git a/kernel/unified/include/wait_q.h b/kernel/unified/include/wait_q.h index 87fd90dc748..a8a358d02bd 100644 --- a/kernel/unified/include/wait_q.h +++ b/kernel/unified/include/wait_q.h @@ -30,13 +30,14 @@ extern "C" { #endif +#ifdef CONFIG_SYS_CLOCK_EXISTS #include - -#if !defined(CONFIG_SYS_CLOCK_EXISTS) - #define _init_thread_timeout(thread) do { } while ((0)) - #define _abort_thread_timeout(thread) do { } while ((0)) - #define _get_next_timeout_expiry() (K_FOREVER) - #define _add_thread_timeout(thread, pq, ticks) do { } while (0) +#else +#define _init_thread_timeout(thread) do { } while ((0)) +#define _nano_timeout_tcs_init(thread) _init_thread_timeout(thread) +#define _add_thread_timeout(thread, wait_q, timeout) do { } while (0) +static inline int _abort_thread_timeout(struct k_thread *thread) { return 0; } +#define _get_next_timeout_expiry() (K_FOREVER) #endif #ifdef __cplusplus