From 125a6a22f81b3cf11732ce2a0e77652661fa0764 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 6 Dec 2013 23:30:10 -0800 Subject: libpayload: Add a timer_us() function. This function returns the number of microseconds scaled from the number of raw timer ticks. It accepts a base parameter which is subtracted from the current time, which makes it easy to keep track of relative times. Change-Id: I55f2f9e90c0e12cda430bbe88b044f12b0b563c8 Signed-off-by: Gabe Black Reviewed-on: https://chromium-review.googlesource.com/179600 Reviewed-by: Ronald Minnich Commit-Queue: Gabe Black Tested-by: Gabe Black (cherry picked from commit 4dd549e18d170dbf918c5b4b11bbe1f4e99b6695) Signed-off-by: Isaac Christensen Reviewed-on: http://review.coreboot.org/6897 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- payloads/libpayload/include/libpayload.h | 1 + 1 file changed, 1 insertion(+) (limited to 'payloads/libpayload/include') diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index 3e48650ec1..b36b40cb7d 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -423,6 +423,7 @@ int lib_get_sysinfo(void); unsigned int get_cpu_speed(void); uint64_t timer_hz(void); uint64_t timer_raw_value(void); +uint64_t timer_us(uint64_t base); /* Generic. */ void ndelay(unsigned int n); void udelay(unsigned int n); -- cgit v1.2.3