From de4f55aa1cd9521b03aa3fc05ede62746948aa14 Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Mon, 21 Sep 2020 10:56:11 -0600 Subject: zephyr: make task_id.h compatible with Zephyr Guard out parts of task_id.h which make the Zephyr build blow up. We don't have task lists defined for Zephyr, so we need to remove that. BUG=b:167590251 BRANCH=none TEST=compile common/timer.c in follow-up CLs Change-Id: Ie6682dd5771e0693874335609ba13a35da715428 Signed-off-by: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427092 Reviewed-by: Jett Rink --- include/task_id.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/task_id.h b/include/task_id.h index 1f191471cc..a4d25ff33b 100644 --- a/include/task_id.h +++ b/include/task_id.h @@ -8,9 +8,11 @@ #ifndef __CROS_EC_TASK_ID_H #define __CROS_EC_TASK_ID_H +#include "config.h" #include "task_filter.h" /* define the name of the header containing the list of tasks */ +#ifndef CONFIG_ZEPHYR #define STRINGIFY0(name) #name #define STRINGIFY(name) STRINGIFY0(name) #define CTS_TASK_LIST STRINGIFY(CTS_TASKFILE) @@ -24,6 +26,7 @@ #ifdef TEST_BUILD #include TEST_TASK_LIST #endif +#endif /* CONFIG_ZEPHYR */ /* Task identifier (8 bits) */ typedef uint8_t task_id_t; @@ -34,10 +37,16 @@ typedef uint8_t task_id_t; * the identifier of a task can be retrieved using the following constant: * TASK_ID_ where is the first parameter passed to the * TASK macro in the TASK_LIST file. + * + * For Zephyr, we still need to define TASK_ID_IDLE, TASK_ID_COUNT, + * and TASK_ID_INVALID, even though we are not using the EC's task + * system. These are prolific enough in the codebase that #ifdef'ing + * out each usage would be infeasible. */ #define TASK(n, ...) TASK_ID_##n, enum { TASK_ID_IDLE, +#ifndef CONFIG_ZEPHYR /* CONFIG_TASK_LIST is a macro coming from the BOARD_TASK_LIST file */ CONFIG_TASK_LIST /* CONFIG_TEST_TASK_LIST is a macro from the TEST_TASK_LIST file */ @@ -47,6 +56,7 @@ enum { #ifdef EMU_BUILD TASK_ID_TEST_RUNNER, #endif +#endif /* CONFIG_ZEPHYR */ /* Number of tasks */ TASK_ID_COUNT, /* Special task identifiers */ -- cgit v1.2.1