diff options
author | Alexandru M Stan <amstan@chromium.org> | 2018-05-10 20:33:32 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-14 15:32:47 -0700 |
commit | fda59e57ff0b1ad29786d35abb5ba189011fb479 (patch) | |
tree | 95b97ba841c1ad19b4de6a0245d0b90e7a6f25e6 /core/host | |
parent | 6c2cbf567e561b2ead187cae5c1749becf7149c4 (diff) | |
download | chrome-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>
Diffstat (limited to 'core/host')
-rw-r--r-- | core/host/timer.c | 5 |
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(); |