mirror of
https://github.com/ipxe/ipxe
synced 2025-12-29 02:52:36 +03:00
[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().
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user