summaryrefslogtreecommitdiffstats
path: root/udelay.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-12-24 03:11:55 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-12-24 03:11:55 +0000
commitbadd99addb64035cc139d22a647ce3f7af753e1d (patch)
tree0522bdd685b608f066795f75bb905b31c3b56b43 /udelay.c
parent21d8739c88726bc84be0e5108579bd4f236d13c2 (diff)
downloadflashrom-badd99addb64035cc139d22a647ce3f7af753e1d.zip
flashrom-badd99addb64035cc139d22a647ce3f7af753e1d.tar.gz
Internal.c was always compiled in because it hosted the function internal_delay()
Move that function to udelay.c and compile internal.c only if really needed. physmap.c is only needed if the programmer is internal or a PCI card. Make its compilation conditional. Corresponding to flashrom svn r822. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <vidwer@gmail.com>
Diffstat (limited to 'udelay.c')
-rw-r--r--udelay.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/udelay.c b/udelay.c
index 9a0ab36..f61d793 100644
--- a/udelay.c
+++ b/udelay.c
@@ -63,3 +63,16 @@ void myusec_calibrate_delay(void)
(unsigned long)micro, timeusec);
printf("OK.\n");
}
+
+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);
+ }
+}
+
OpenPOWER on IntegriCloud