summaryrefslogtreecommitdiffstats
path: root/internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'internal.c')
-rw-r--r--internal.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal.c b/internal.c
index c2d8f6b..d24bb34 100644
--- a/internal.c
+++ b/internal.c
@@ -195,6 +195,18 @@ uint32_t mmio_readl(void *addr)
return *(volatile uint32_t *) addr;
}
+void internal_delay(int usecs)
+{
+ /* If the delay is >1 s, use usleep because timing does not need to
+ * be so precise.
+ */
+ if (usecs > 1000000) {
+ usleep(usecs);
+ } else {
+ myusec_delay(usecs);
+ }
+}
+
/* Fallback map() for programmers which don't need special handling */
void *fallback_map(const char *descr, unsigned long phys_addr, size_t len)
{
OpenPOWER on IntegriCloud