timestamp: Add function to get time since boot

Hardware / Coreboot - Werner Zeh [siemens.com] - 14 September 2017 14:12 EDT

Add a function to retrieve the elapsed time since boot. For that purpose use the base time in the timestamp table among with the current timestamp at call time of the function. So more precise the returned time is the elapsed time since the timestamp was initialized scaled in microseconds. This was chosen to get a reliable value even on platforms where the TSC might not be reset on software reset or warm start.

Change-Id: Ib93ad89078645c0ebe256048cb48f9622c90451f

35cceb8 timestamp: Add function to get time since boot
src/include/timestamp.h | 10 ++++++++++
src/lib/timestamp.c | 14 ++++++++++++++
2 files changed, 24 insertions(+)

Upstream: review.coreboot.org


  • Share