summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru M Stan <amstan@chromium.org>2018-05-10 20:33:32 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-14 15:32:47 -0700
commitfda59e57ff0b1ad29786d35abb5ba189011fb479 (patch)
tree95b97ba841c1ad19b4de6a0245d0b90e7a6f25e6
parent6c2cbf567e561b2ead187cae5c1749becf7149c4 (diff)
downloadchrome-ec-fda59e57ff0b1ad29786d35abb5ba189011fb479.tar.gz
host: add __hw_clock_source_read
Sometimes common code needs __hw_clock_source_read, add it. The implementation is similar of what common/timer.c does to create a ts for get_time(), but in reverse. TEST=Unit tests pass again for the next CL BRANCH=master BUG=None Change-Id: I10564abedabe88e4789723bc97bac170ae020c69 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1055191 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--core/host/timer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/host/timer.c b/core/host/timer.c
index 124f17c14f..1c1fe01457 100644
--- a/core/host/timer.c
+++ b/core/host/timer.c
@@ -67,6 +67,11 @@ timestamp_t get_time(void)
return ret;
}
+uint32_t __hw_clock_source_read(void)
+{
+ return get_time().le.lo;
+}
+
void force_time(timestamp_t ts)
{
timestamp_t now = _get_time();