timer: Add helper function stopwatch_wait_until_expired
Change-Id: Ia888907028d687e3d17e5a088657086a3c839ad3 Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/21589 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
6c521d3897
commit
109ba284a1
|
@ -165,6 +165,15 @@ static inline int stopwatch_expired(struct stopwatch *sw)
|
||||||
return !mono_time_before(&sw->current, &sw->expires);
|
return !mono_time_before(&sw->current, &sw->expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tick and check the stopwatch as long as it has not expired.
|
||||||
|
*/
|
||||||
|
static inline void stopwatch_wait_until_expired(struct stopwatch *sw)
|
||||||
|
{
|
||||||
|
while (!stopwatch_expired(sw))
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return number of microseconds since starting the stopwatch.
|
* Return number of microseconds since starting the stopwatch.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue