summaryrefslogtreecommitdiffstats
path: root/src/include/unistd.h
diff options
context:
space:
mode:
authorMichael Brown2008-10-12 20:56:52 +0200
committerMichael Brown2008-10-12 21:22:02 +0200
commit16f1e35775c972ba8e02bc2d97d7a2eb333eae1b (patch)
treef653099d4b230c9807986aa2b4cd89dce2cffe9b /src/include/unistd.h
parent[process] Add DBG2() messages to help track down frozen processes (diff)
downloadipxe-16f1e35775c972ba8e02bc2d97d7a2eb333eae1b.tar.gz
ipxe-16f1e35775c972ba8e02bc2d97d7a2eb333eae1b.tar.xz
ipxe-16f1e35775c972ba8e02bc2d97d7a2eb333eae1b.zip
[timer] Formalise the timer API
We now have two implementations for the timer API: one using the time-of-day counter at 40:70 and one using RDTSC. Both make use of timer2_udelay().
Diffstat (limited to 'src/include/unistd.h')
-rw-r--r--src/include/unistd.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/include/unistd.h b/src/include/unistd.h
index 7c44a0ce..dc1f67f6 100644
--- a/src/include/unistd.h
+++ b/src/include/unistd.h
@@ -4,7 +4,6 @@
#include <stddef.h>
#include <stdarg.h>
-unsigned int sleep ( unsigned int seconds );
extern int execv ( const char *command, char * const argv[] );
/**
@@ -22,10 +21,21 @@ extern int execv ( const char *command, char * const argv[] );
rc; \
} )
-void udelay(unsigned int usecs);
-void mdelay(unsigned int msecs);
+/* Pick up udelay() */
+#include <gpxe/timer.h>
-#define usleep(x) udelay(x)
+/*
+ * sleep() prototype is defined by POSIX.1. usleep() prototype is
+ * defined by 4.3BSD. udelay() and mdelay() prototypes are chosen to
+ * be reasonably sensible.
+ *
+ */
+
+extern unsigned int sleep ( unsigned int seconds );
+extern void mdelay ( unsigned long msecs );
+static inline __always_inline void usleep ( unsigned long usecs ) {
+ udelay ( usecs );
+}
#endif /* _UNISTD_H */