mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
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>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
26984c7de4
commit
73a8098d79
@@ -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;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef __CROS_EC_TIMER_H
|
||||
#define __CROS_EC_TIMER_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "task_id.h"
|
||||
|
||||
@@ -146,4 +148,11 @@ static inline unsigned time_since32(timestamp_t start)
|
||||
return get_time().le.lo - start.le.lo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a free running high resolution (ten us or better) clock.
|
||||
*
|
||||
* Used by third party libraries requiring MSDN services.
|
||||
*/
|
||||
clock_t clock(void);
|
||||
|
||||
#endif /* __CROS_EC_TIMER_H */
|
||||
|
||||
Reference in New Issue
Block a user