diff options
author | Jett Rink <jettrink@chromium.org> | 2020-11-06 15:10:50 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-09 19:13:23 +0000 |
commit | 3afeb0c2f9c92146c20b540e8d4e4c9ef1afc9d1 (patch) | |
tree | 87a818f6bd230db6dff61f0a9f361f7dfc1034b8 | |
parent | 4d3243b69375f20f6e61bcc73f03cb10510457b3 (diff) | |
download | chrome-ec-3afeb0c2f9c92146c20b540e8d4e4c9ef1afc9d1.tar.gz |
zephyr: correct shimmed task priorities
Add build assert to ensure that deferred task is lower than all of the
other shimmed tasks.
Also make priority of tasks from 0 to COUNT - 1 instead of 1 to COUNT
BRANCH=none
BUG=none
TEST=volteer still builds
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: Iabe9f1117850975ec9bf3df1dcfc690b4725a7e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523389
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | zephyr/shim/src/tasks.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zephyr/shim/src/tasks.c b/zephyr/shim/src/tasks.c index d3382a655b..70f746ddc9 100644 --- a/zephyr/shim/src/tasks.c +++ b/zephyr/shim/src/tasks.c @@ -10,7 +10,8 @@ #include "shimmed_tasks.h" #include "task.h" -BUILD_ASSERT(CONFIG_NUM_PREEMPT_PRIORITIES >= TASK_ID_COUNT, +/* We need to ensure that is one lower priority for the deferred task */ +BUILD_ASSERT(CONFIG_NUM_PREEMPT_PRIORITIES + 1 >= TASK_ID_COUNT, "Must increase number of available preempt priorities"); /* Ensure all of the manually defined HAS_TASK_ defines are present */ @@ -196,6 +197,6 @@ void start_ec_tasks(void) ctx->zephyr_tid = k_thread_create( &ctx->zephyr_thread, ctx->stack, ctx->stack_size, task_entry, ctx, NULL, NULL, - K_PRIO_PREEMPT(TASK_ID_COUNT - i), 0, K_NO_WAIT); + K_PRIO_PREEMPT(TASK_ID_COUNT - i - 1), 0, K_NO_WAIT); } } |