diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-11-20 13:57:13 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-11-21 00:09:09 +0000 |
commit | 5524ba7bf71b8ee520f3c8410b65b5bba07544c4 (patch) | |
tree | d28c48dc6dc1e5817414adf06d5124d30704fa17 | |
parent | 7f5019c9e34319265933b347d493ec28e2ff015d (diff) | |
download | chrome-ec-5524ba7bf71b8ee520f3c8410b65b5bba07544c4.tar.gz |
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 <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177452
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | include/timer.h | 11 |
1 files changed, 10 insertions, 1 deletions
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) |