diff options
-rw-r--r-- | core/timebase.c | 18 | ||||
-rw-r--r-- | include/timebase.h | 9 |
2 files changed, 24 insertions, 3 deletions
diff --git a/core/timebase.c b/core/timebase.c index 0c4d5e9..bf378ed 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; diff --git a/include/timebase.h b/include/timebase.h index 11ab126..a1b787f 100644 --- a/include/timebase.h +++ b/include/timebase.h @@ -79,13 +79,16 @@ static inline unsigned long tb_to_usecs(unsigned long tb) extern unsigned long timespec_to_tb(const struct timespec *ts); -/* wait_poll - Wait a certain number of TB ticks while polling FSP */ +/* time_wait - Wait a certain number of TB ticks while polling FSP */ extern void time_wait(unsigned long duration); +extern void time_wait_nopoll(unsigned long duration); -/* wait_poll_ms - Wait a certain number of milliseconds while polling FSP */ +/* time_wait_ms - Wait a certain number of milliseconds while polling FSP */ extern void time_wait_ms(unsigned long ms); +extern void time_wait_ms_nopoll(unsigned long ms); -/* wait_poll_us - Wait a certain number of microseconds while polling FSP */ +/* time_wait_us - Wait a certain number of microseconds while polling FSP */ extern void time_wait_us(unsigned long us); +extern void time_wait_us_nopoll(unsigned long us); #endif /* __TIME_H */ |