diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-08 12:27:18 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-08 12:36:29 +1000 |
commit | e6596b210b86c4d46395299ca27c380be9781693 (patch) | |
tree | bd9cdb19424c0c4606b5691c32c9c7fde73f0ff7 /core | |
parent | e74abeb3c34dcbfcf0d1b3c4462178d9c543c3a9 (diff) | |
download | talos-skiboot-e6596b210b86c4d46395299ca27c380be9781693.tar.gz talos-skiboot-e6596b210b86c4d46395299ca27c380be9781693.zip |
timebase: Add "nopoll" variants of the delays
In case where we don't want to recurse into opal pollers
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/timebase.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/timebase.c b/core/timebase.c index 0c4d5e9c..bf378ed1 100644 --- a/core/timebase.c +++ b/core/timebase.c @@ -25,16 +25,34 @@ void time_wait(unsigned long duration) opal_run_pollers(); } +void time_wait_nopoll(unsigned long duration) +{ + unsigned long end = mftb() + duration; + + while(tb_compare(mftb(), end) != TB_AAFTERB) + ; +} + void time_wait_ms(unsigned long ms) { time_wait(msecs_to_tb(ms)); } +void time_wait_ms_nopoll(unsigned long ms) +{ + time_wait_nopoll(msecs_to_tb(ms)); +} + void time_wait_us(unsigned long us) { time_wait(usecs_to_tb(us)); } +void time_wait_us_nopoll(unsigned long us) +{ + time_wait_nopoll(usecs_to_tb(us)); +} + unsigned long timespec_to_tb(const struct timespec *ts) { unsigned long ns; |