[coreboot-gerrit] New patch to review for coreboot: 7babeb1 timestamp: provide weak default implementation of timestamp_get
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Tue May 5 15:15:33 CEST 2015
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10104
-gerrit
commit 7babeb15a4b1efe8298484366cd4c61710271680
Author: Aaron Durbin <adurbin at chromium.org>
Date: Fri May 1 16:48:54 2015 -0500
timestamp: provide weak default implementation of timestamp_get
Change-Id: I2e7f17a686f6af3426c9d68cd9394e9a88dbf358
Signed-off-by: Aaron Durbin <adurbin at chromium.org>
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
src/lib/timestamp.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 9a0e631..0c9c884 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -174,3 +174,14 @@ void timestamp_reinit(void)
/* Call timestamp_reinit at CAR migration time. */
CAR_MIGRATE(timestamp_reinit)
+
+/* Provide default timestamp implementation using monotonic timer. */
+uint64_t __attribute__((weak)) timestamp_get(void)
+{
+ struct mono_time t1, t2;
+
+ mono_time_set_usecs(&t1, 0);
+ timer_monotonic_get(&t2);
+
+ return mono_time_diff_microseconds(&t1, &t2);
+}
More information about the coreboot-gerrit
mailing list