timestamp: provide weak default implementation of timestamp_get
Change-Id: I2e7f17a686f6af3426c9d68cd9394e9a88dbf358 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10104 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
parent
ae1fcc3c1d
commit
9e80e27d38
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue