summaryrefslogtreecommitdiff
path: root/udelay.c
diff options
context:
space:
mode:
authoroxygene <oxygene@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-09-30 17:03:32 +0000
committeroxygene <oxygene@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-09-30 17:03:32 +0000
commitd83d4070bfc116a32ca7b365cd7a614e1b6202ed (patch)
treef79ff036266bb09b180f27b3552dd30116a221e4 /udelay.c
parent198af25a1f5570d9d7351f1bbfdc3e38e975fc27 (diff)
downloadflashrom-d83d4070bfc116a32ca7b365cd7a614e1b6202ed.tar.gz
Add support for building flashrom against libpayload.
This doesn't include changes to the frontend which must be done separately, so this won't work out of the box. This code was tested on hardware. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1184 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'udelay.c')
-rw-r--r--udelay.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/udelay.c b/udelay.c
index 981b1bb..153f510 100644
--- a/udelay.c
+++ b/udelay.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifndef __LIBPAYLOAD__
+
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
@@ -179,3 +181,15 @@ void internal_delay(int usecs)
}
}
+#else
+
+void myusec_calibrate_delay(void)
+{
+ get_cpu_speed();
+}
+
+void internal_delay(int usecs)
+{
+ udelay(usecs);
+}
+#endif