From e669559010390502c4fa80db1e2e4d9df0954b8a Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Sat, 14 Jan 2017 18:50:22 -0500 Subject: [PATCH] kernel: fix main/work_q prios in coop/preempt-only modes -1 is reserved for the idle thread in coop-only mode and -1 does not exist as a priority in preempt-only mode. With this change, the philosophers demo runs in preempt-only mode. Change-Id: Id15a6eafc7582966deaf0db9ed6960b5da74be33 Signed-off-by: Benjamin Walsh --- kernel/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/Kconfig b/kernel/Kconfig index 748a5f883ad..d1699471b65 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -89,7 +89,7 @@ config MAIN_THREAD_PRIORITY int prompt "Priority of initialization/main thread" default 0 - default -1 if NUM_PREEMPT_PRIORITIES = 0 + default -2 if !PREEMPT_ENABLED help Priority at which the initialization thread runs, including the start of the main() function. main() can then change its priority if desired. @@ -231,6 +231,8 @@ config SYSTEM_WORKQUEUE_STACK_SIZE config SYSTEM_WORKQUEUE_PRIORITY int "System workqueue priority" default -1 + default 0 if !COOP_ENABLED + default -2 if COOP_ENABLED && !PREEMPT_ENABLED config OFFLOAD_WORKQUEUE_STACK_SIZE int "Workqueue stack size for thread offload requests"