summaryrefslogtreecommitdiff
path: root/include/timer.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-05-11 17:27:32 -0700
committerSimon Glass <sjg@chromium.org>2012-05-14 09:12:50 -0700
commitfddbc9edc4bd0f62493c81cfd7e3a22d6277ba39 (patch)
tree9b07e1c2545393a70d9959d563a0c8c9cf19b5ed /include/timer.h
parentfb0d6f078dd70f05079db829902de84b378548fb (diff)
downloadchrome-ec-fddbc9edc4bd0f62493c81cfd7e3a22d6277ba39.tar.gz
timer: Allow callers to pass 'now' to timestamp_expired()
To avoid calling get_time() when the caller already knows the value, add a parameter to timestamp_expired(). BUG=chrome-os-partner:9424 TEST=build and boot on Daisy Change-Id: Ibb97c86f429ec4b814e17b41cbf79b612a75097a Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/timer.h')
-rw-r--r--include/timer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/timer.h b/include/timer.h
index 796318a1d0..ed076d5199 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -34,9 +34,10 @@ int timer_cancel(task_id_t tskid);
* Check if a timestamp has passed / expired
*
* @param deadline deadline timer value to check
+ * @param now pointer to value of time_now() if known, else NULL
* @return 0 if deadline has not yet passed, 1 if it has passed
*/
-int timestamp_expired(timestamp_t deadline);
+int timestamp_expired(timestamp_t deadline, const timestamp_t *now);
/* Busy-wait the selected number of microseconds. Note that calling this
* with us>1000 may impact system performance; use usleep for longer delays. */