kernel: correct the highest priority in coop-only modes

In such a case, the system must take the idle coop priority into
account.

Change-Id: Ica5a4a7a659cb165073e9b8042a77ed23a6a662a
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
This commit is contained in:
Benjamin Walsh 2017-01-14 18:47:22 -05:00 committed by Anas Nashif
commit edb3570913

View file

@ -59,10 +59,14 @@ extern "C" {
#define K_ANY NULL
#define K_END NULL
#if CONFIG_NUM_COOP_PRIORITIES > 0
#if defined(CONFIG_COOP_ENABLED) && defined(CONFIG_PREEMPT_ENABLED)
#define K_HIGHEST_THREAD_PRIO (-CONFIG_NUM_COOP_PRIORITIES)
#else
#elif defined(CONFIG_COOP_ENABLED)
#define K_HIGHEST_THREAD_PRIO (-CONFIG_NUM_COOP_PRIORITIES - 1)
#elif defined(CONFIG_PREEMPT_ENABLED)
#define K_HIGHEST_THREAD_PRIO 0
#else
#error "invalid configuration"
#endif
#if CONFIG_NUM_PREEMPT_PRIORITIES > 0