diff options
author | Rob Barnes <robbarnes@google.com> | 2023-02-01 11:30:14 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-02-15 15:59:12 +0000 |
commit | 192cb39d9c872f8f58ccae263384d4579d3d91bc (patch) | |
tree | 7421cb28caee617e09e07d632fd131241f5e7c9e /zephyr/shim/src/host_command.c | |
parent | a4b1da633cca2333820cd053055b259d3929bda5 (diff) | |
download | chrome-ec-192cb39d9c872f8f58ccae263384d4579d3d91bc.tar.gz |
tasks: Add extra MAIN task id
Add TASK_ID_MAIN as a non-shimmed extra task. This task is only present
when CONFIG_TASK_HOSTCMD_THREAD_DEDICATED is enabled.
Add get_hostcmd_thread and get_main_thread helper methods. The hostcmd
thread will be the same as the main thread when
CONFIG_TASK_HOSTCMD_THREAD_MAIN is enabled.
BUG=b:267470086
BRANCH=None
TEST=Unit tests
Change-Id: If61dca427686a9c3cf6fb05dc5ca4e5a87b47127
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214560
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Diffstat (limited to 'zephyr/shim/src/host_command.c')
-rw-r--r-- | zephyr/shim/src/host_command.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/zephyr/shim/src/host_command.c b/zephyr/shim/src/host_command.c index 2e55099de2..5ca84c944a 100644 --- a/zephyr/shim/src/host_command.c +++ b/zephyr/shim/src/host_command.c @@ -19,18 +19,10 @@ struct host_command *zephyr_find_host_command(int command) return NULL; } -/* Pointer to the main thread, defined in kernel/init.c */ -extern struct k_thread z_main_thread; - void host_command_main(void) { - k_thread_priority_set(&z_main_thread, + k_thread_priority_set(get_main_thread(), EC_TASK_PRIORITY(EC_TASK_HOSTCMD_PRIO)); - k_thread_name_set(&z_main_thread, "HOSTCMD"); + k_thread_name_set(get_main_thread(), "HOSTCMD"); host_command_task(NULL); } - -test_mockable bool in_host_command_main(void) -{ - return (k_current_get() == &z_main_thread); -} |