summaryrefslogtreecommitdiff
path: root/common/timer.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-07-30 14:36:32 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-14 21:04:32 +0000
commit73a8098d79d84292ff56674f843f73753520fcbd (patch)
tree0c068529910d7de373a858b49ea9ad02ea898e9b /common/timer.c
parent26984c7de4ac14347e8395e6e111677a707807f2 (diff)
downloadchrome-ec-73a8098d79d84292ff56674f843f73753520fcbd.tar.gz
export MSDN clock() function
TPM implementation requires a free running clock with granularity better than a 10 us. clock_t definition comes from the toolchain includes. BRANCH=none BUG=chrome-os-partner:43025 TEST=none yet Change-Id: Id3de5fd055aa598afe15657011b88d2c6be4cdfb Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/289953 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/timer.c')
-rw-r--r--common/timer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/timer.c b/common/timer.c
index 8538635218..4fa2e6b93b 100644
--- a/common/timer.c
+++ b/common/timer.c
@@ -184,6 +184,11 @@ timestamp_t get_time(void)
return ts;
}
+clock_t clock(void)
+{
+ return (clock_t) __hw_clock_source_read();
+}
+
void force_time(timestamp_t ts)
{
clksrc_high = ts.le.hi;