summaryrefslogtreecommitdiff
path: root/include/task.h
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-10-27 13:41:23 -0600
committerCommit Bot <commit-bot@chromium.org>2020-11-03 08:47:12 +0000
commitbf2d7da23cb9c3316bd746226c90ff05d1071f9f (patch)
tree8e9f0d4cb255f8f8c7366c93b67ef9e3e8189478 /include/task.h
parent9c7752544ff0128b63f9ef5067ab2d3fa8c2b418 (diff)
downloadchrome-ec-bf2d7da23cb9c3316bd746226c90ff05d1071f9f.tar.gz
zephyr: punt implementing some task functions
This makes it so that we have to ifdef out less tasks code when shimming, adding runtime warnings about the code we are skipping. BUG=b:171741620 BRANCH=none TEST=compile power sequencing code, observe warnings Change-Id: I5e6686d00c04654afe458eef2690d8f6c5bd6639 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2503787 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/task.h')
-rw-r--r--include/task.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/task.h b/include/task.h
index cf72e57680..3d845b3fd8 100644
--- a/include/task.h
+++ b/include/task.h
@@ -12,6 +12,17 @@
#include "compile_time_macros.h"
#include "task_id.h"
+#ifdef CONFIG_ZEPHYR
+#include <sys/printk.h>
+#define _ZEPHYR_WARN_UNIMPLEMENTED(func, args...) \
+ printk("WARN: not implemented - %s(%s)\n", #func, #args)
+#define _ZEPHYR_WARN_UNIMPLEMENTED_AND_RETURN(func, rv, ...) \
+ ({ \
+ _ZEPHYR_WARN_UNIMPLEMENTED(func, ...); \
+ rv; \
+ })
+#endif
+
/* Task event bitmasks */
/* Tasks may use the bits in TASK_EVENT_CUSTOM_BIT for their own events */
#define TASK_EVENT_CUSTOM_BIT(x) BUILD_CHECK_INLINE(BIT(x), BIT(x) & 0x0ffff)
@@ -133,17 +144,27 @@ void set_int_mask(uint32_t val);
* interrupt context.
* @return The bitmap of events which occurred if wait!=0, else 0.
*/
+#ifdef CONFIG_ZEPHYR
+#define task_set_event(tskid, event, wait) \
+ _ZEPHYR_WARN_UNIMPLEMENTED_AND_RETURN(task_set_event, 0L, tskid, \
+ event, wait)
+#else
uint32_t task_set_event(task_id_t tskid, uint32_t event, int wait);
+#endif
/**
* Wake a task. This sends it the TASK_EVENT_WAKE event.
*
* @param tskid Task to wake
*/
+#ifdef CONFIG_ZEPHYR
+#define task_wake(tskid) _ZEPHYR_WARN_UNIMPLEMENTED(task_wake, tskid)
+#else
static inline void task_wake(task_id_t tskid)
{
task_set_event(tskid, TASK_EVENT_WAKE, 0);
}
+#endif
/**
* Return the identifier of the task currently running.