From 141512161b40666e83094d8d99c544ce9a74ab8f Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 16 Sep 2013 14:23:16 -0700 Subject: vboot: Implement VbExGetTimer using monotonic timers On x86 VbExGetTimer() uses rdtsc. However, on all other platforms, let's just use coreboot's monotonic timers. Change-Id: I0cd359f298be33776740305b111624147e2c850d Signed-off-by: Stefan Reinauer Reviewed-on: https://chromium-review.googlesource.com/169620 (cherry picked from commit e910bb17522d5de42c0fc3cc945278e733fa2553) Signed-off-by: Isaac Christensen Reviewed-on: http://review.coreboot.org/6534 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/vendorcode/google/chromeos/vboot_wrapper.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/vendorcode/google/chromeos/vboot_wrapper.c b/src/vendorcode/google/chromeos/vboot_wrapper.c index fe3c022833..d008de17cb 100644 --- a/src/vendorcode/google/chromeos/vboot_wrapper.c +++ b/src/vendorcode/google/chromeos/vboot_wrapper.c @@ -17,7 +17,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include +#if CONFIG_ARCH_X86 #include +#else +#include +#endif #include #include #include @@ -123,7 +127,13 @@ void VbExDebug(const char *format, ...) uint64_t VbExGetTimer(void) { +#if CONFIG_ARCH_X86 return rdtscll(); +#else + struct mono_time mt; + timer_monotonic_get(&mt); + return mt.microseconds; +#endif } VbError_t VbExNvStorageRead(uint8_t *buf) -- cgit v1.2.3