summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorBenjamin Walsh <benjamin.walsh@windriver.com>2016-10-06 15:04:23 -0400
committerBenjamin Walsh <benjamin.walsh@windriver.com>2016-10-10 21:27:41 +0000
commit1a5450bb8e0e1776618f4dcc035737cf91821299 (patch)
tree4ac80c3e026eee6a84df3c145a097e6ccfdb3086 /kernel
parent8ae55deaf92287697723ed9d574474e7ef2cecf1 (diff)
unified: merge NANO_TIMERS and NANO_TIMEOUTS with SYS_CLOCK_EXISTS
Timers are based off timeouts now, which can only be enabled when the system clock is enabled. So the three are really just one setting now. Keep the NANO_TIMERS and NANO_TIMEOUTS around for now until all middleware that rely on them is updated. They are always enabled when SYS_CLOCK_EXISTS is enabled. Change-Id: Iaef1302ef9ad8fc5640542ab6d7304d67aafcfdc Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/unified/Kconfig11
-rw-r--r--kernel/unified/Makefile2
-rw-r--r--kernel/unified/include/timeout_q.h4
-rw-r--r--kernel/unified/include/wait_q.h10
-rw-r--r--kernel/unified/init.c2
-rw-r--r--kernel/unified/legacy/Makefile2
-rw-r--r--kernel/unified/sys_clock.c2
-rw-r--r--kernel/unified/thread.c2
8 files changed, 12 insertions, 23 deletions
diff --git a/kernel/unified/Kconfig b/kernel/unified/Kconfig
index f0b81fddb..d8afd2341 100644
--- a/kernel/unified/Kconfig
+++ b/kernel/unified/Kconfig
@@ -132,22 +132,19 @@ config THREAD_CUSTOM_DATA
config NANO_TIMEOUTS
bool
- prompt "Enable timeouts on nanokernel objects"
default y
depends on SYS_CLOCK_EXISTS
help
- Allow fibers and tasks to wait on nanokernel objects with a timeout, by
- enabling the nano_xxx_wait_timeout APIs, and allow fibers to sleep for a
- period of time, by enabling the fiber_sleep API.
+ Only here for common (ie. non-unified kernel) code that rely on this.
+ Unified kernel uses SYS_CLOCK_EXISTS everywhere instead.
config NANO_TIMERS
bool
- prompt "Enable nanokernel timers"
default y
depends on SYS_CLOCK_EXISTS
help
- Allow fibers and tasks to wait on nanokernel timers, which can be
- accessed using the nano_timer_xxx() APIs.
+ Only here for common (ie. non-unified kernel) code that rely on this.
+ Unified kernel uses SYS_CLOCK_EXISTS everywhere instead.
config NUM_DYNAMIC_TIMERS
int
diff --git a/kernel/unified/Makefile b/kernel/unified/Makefile
index 1c35350c6..ef8e0235a 100644
--- a/kernel/unified/Makefile
+++ b/kernel/unified/Makefile
@@ -38,7 +38,7 @@ lib-y += $(strip \
lib-$(CONFIG_INT_LATENCY_BENCHMARK) += int_latency_bench.o
lib-$(CONFIG_STACK_CANARIES) += compiler_stack_protect.o
-lib-$(CONFIG_NANO_TIMERS) += timer.o
+lib-$(CONFIG_SYS_CLOCK_EXISTS) += timer.o
lib-$(CONFIG_KERNEL_EVENT_LOGGER) += event_logger.o
lib-$(CONFIG_KERNEL_EVENT_LOGGER) += kernel_event_logger.o
lib-$(CONFIG_RING_BUFFER) += ring_buffer.o
diff --git a/kernel/unified/include/timeout_q.h b/kernel/unified/include/timeout_q.h
index e99464159..20a1686c7 100644
--- a/kernel/unified/include/timeout_q.h
+++ b/kernel/unified/include/timeout_q.h
@@ -29,7 +29,7 @@
extern "C" {
#endif
-#if defined(CONFIG_NANO_TIMEOUTS)
+#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)
@@ -93,7 +93,7 @@ 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_NANO_TIMEOUTS */
+#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 34af5cca8..87fd90dc7 100644
--- a/kernel/unified/include/wait_q.h
+++ b/kernel/unified/include/wait_q.h
@@ -30,20 +30,12 @@
extern "C" {
#endif
-#if defined(CONFIG_NANO_TIMEOUTS)
#include <timeout_q.h>
-#elif defined(CONFIG_NANO_TIMERS)
-#include <timeout_q.h>
- #define _init_thread_timeout(thread) do { } while ((0))
- #define _abort_thread_timeout(thread) do { } while ((0))
-
- #define _add_thread_timeout(thread, pq, ticks) do { } while (0)
-#else
+#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)
#endif
diff --git a/kernel/unified/init.c b/kernel/unified/init.c
index 49deb35a7..9a5acb824 100644
--- a/kernel/unified/init.c
+++ b/kernel/unified/init.c
@@ -101,7 +101,7 @@ k_tid_t const _idle_thread = (k_tid_t)idle_stack;
#endif
char __noinit __stack _interrupt_stack[CONFIG_ISR_STACK_SIZE];
-#if defined(CONFIG_NANO_TIMEOUTS) || defined(CONFIG_NANO_TIMERS)
+#ifdef CONFIG_SYS_CLOCK_EXISTS
#include <misc/dlist.h>
#define initialize_timeouts() do { \
sys_dlist_init(&_nanokernel.timeout_q); \
diff --git a/kernel/unified/legacy/Makefile b/kernel/unified/legacy/Makefile
index 0666dd439..5bc76415a 100644
--- a/kernel/unified/legacy/Makefile
+++ b/kernel/unified/legacy/Makefile
@@ -6,4 +6,4 @@ obj-y =
obj-y += $(strip \
)
-obj-$(CONFIG_NANO_TIMERS) += timer_legacy.o
+obj-$(CONFIG_SYS_CLOCK_EXISTS) += timer_legacy.o
diff --git a/kernel/unified/sys_clock.c b/kernel/unified/sys_clock.c
index 6c18a965d..b1917d6f3 100644
--- a/kernel/unified/sys_clock.c
+++ b/kernel/unified/sys_clock.c
@@ -173,7 +173,7 @@ uint32_t k_uptime_delta_32(int64_t *reftime)
/* handle the expired timeouts in the nano timeout queue */
-#if defined(CONFIG_NANO_TIMEOUTS) || defined(CONFIG_NANO_TIMERS)
+#ifdef CONFIG_SYS_CLOCK_EXISTS
#include <wait_q.h>
static inline void handle_expired_timeouts(int32_t ticks)
diff --git a/kernel/unified/thread.c b/kernel/unified/thread.c
index 7f711e799..39430592a 100644
--- a/kernel/unified/thread.c
+++ b/kernel/unified/thread.c
@@ -266,7 +266,7 @@ static void start_thread(struct k_thread *thread)
static void schedule_new_thread(struct k_thread *thread, int32_t delay)
{
-#ifdef CONFIG_NANO_TIMEOUTS
+#ifdef CONFIG_SYS_CLOCK_EXISTS
if (delay == 0) {
start_thread(thread);
} else {