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>
This commit is contained in:
Alexandru M Stan
2018-05-10 20:33:32 -07:00
committed by chrome-bot
parent 6c2cbf567e
commit fda59e57ff

View File

@@ -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();