summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-03-18 09:27:14 -0600
committerCommit Bot <commit-bot@chromium.org>2021-03-20 03:25:36 +0000
commit674108fb834d5ba2e1fb2ebb78aa293eec3aee44 (patch)
treeb6590d91f218499d538012e8b34d5b8cb6181bd5 /common
parent7badef3bb2620762b119d9d8662aaf0a19c55778 (diff)
downloadchrome-ec-674108fb834d5ba2e1fb2ebb78aa293eec3aee44.tar.gz
zephyr: implement task timers
CrOS EC OS provides one implicit timer associated with every task (see docs/core_runtime.md). As luck has it, we never needed these implicit timers for volteer, but ARM power sequencing code uses it. This implements the timer_arm and timer_cancel functions, which function equivalently to how they would in CrOS EC OS. (Note: we previously were compiling timer_arm and timer_cancel from CrOS EC, but these definitions were non-functional as we never call process_timers from Zephyr). BUG=b:183058135 BRANCH=none TEST=provided unit tests pass Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ibad20002c489a8149efde713d8273adae835f653 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774362 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/timer.c b/common/timer.c
index d0386a9eca..d0d3c80024 100644
--- a/common/timer.c
+++ b/common/timer.c
@@ -122,6 +122,8 @@ void udelay(unsigned us)
}
#endif
+/* Zephyr provides its own implementation in task shim */
+#ifndef CONFIG_ZEPHYR
int timer_arm(timestamp_t event, task_id_t tskid)
{
timestamp_t now = get_time();
@@ -152,6 +154,7 @@ void timer_cancel(task_id_t tskid)
* timer-related housekeeping when the next timer interrupt fires.
*/
}
+#endif
/*
* For us < (2^31 - task scheduling latency)(~ 2147 sec), this function will