aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-08 12:27:18 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-08 12:36:29 +1000
commite6596b210b86c4d46395299ca27c380be9781693 (patch)
treebd9cdb19424c0c4606b5691c32c9c7fde73f0ff7
parente74abeb3c34dcbfcf0d1b3c4462178d9c543c3a9 (diff)
downloadskiboot-e6596b210b86c4d46395299ca27c380be9781693.zip
skiboot-e6596b210b86c4d46395299ca27c380be9781693.tar.gz
skiboot-e6596b210b86c4d46395299ca27c380be9781693.tar.bz2
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>
-rw-r--r--core/timebase.c18
-rw-r--r--include/timebase.h9
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 */