summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-09-21 10:56:11 -0600
committerCommit Bot <commit-bot@chromium.org>2020-10-01 19:14:12 +0000
commitde4f55aa1cd9521b03aa3fc05ede62746948aa14 (patch)
tree5c2fd778040e3b5911994ef8929d0609e423f400
parent0ced06f23926b4670e538f027f3943b55a5c2231 (diff)
downloadchrome-ec-de4f55aa1cd9521b03aa3fc05ede62746948aa14.tar.gz
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 <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427092 Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--include/task_id.h10
1 files changed, 10 insertions, 0 deletions
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_<taskname> where <taskname> 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 */