From 5524ba7bf71b8ee520f3c8410b65b5bba07544c4 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Wed, 20 Nov 2013 13:57:13 -0800 Subject: [PATCH] cleanup: More comments in timer.h Indicate when usleep() and udelay() may be called. No code changes, just comments. BUG=none BRANCH=none TEST=Build any platform. Heck, it's just comments. Change-Id: I0182c153c29965b25d5294d838c1406c30115099 Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/177452 Reviewed-by: Vincent Palatin --- include/timer.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/timer.h b/include/timer.h index b13e0a62a0..ddeb79a318 100644 --- a/include/timer.h +++ b/include/timer.h @@ -60,6 +60,9 @@ int timestamp_expired(timestamp_t deadline, const timestamp_t *now); /** * Busy-wait. * + * This may be called with interrupts disabled, at any time after timer_init() + * has been called. + * * Note that calling this with us>1000 may impact system performance; use * usleep() for longer delays. * @@ -74,12 +77,16 @@ void udelay(unsigned us); * perhaps longer, if a higher-priority task is running when the delay * expires). * + * This may only be called from a task function, with interrupts enabled. + * * @param us Number of microseconds to sleep. */ void usleep(unsigned us); /** - * Sleep for milliseconds + * Sleep for milliseconds. + * + * Otherwise the same as usleep(). * * @param ms Number of milliseconds to sleep. */ @@ -91,6 +98,8 @@ static inline void msleep(unsigned ms) /** * Sleep for seconds * + * Otherwise the same as usleep(). + * * @param sec Number of seconds to sleep. */ static inline void sleep(unsigned sec)