diff options
| author | Michael Brown | 2008-03-10 14:02:53 +0100 |
|---|---|---|
| committer | Michael Brown | 2008-03-10 14:02:53 +0100 |
| commit | 3e781eb87f7b5bfa638f94234bb5e9d64508b0a4 (patch) | |
| tree | 5884ac0438320638c846166856a4b54b3564bd23 /src/include/gpxe | |
| parent | [PXE] Work around a buffer-size bug in WinPE (diff) | |
| parent | Use plain C in timer_rdtsc for division instead of inline asssembly. (diff) | |
| download | ipxe-3e781eb87f7b5bfa638f94234bb5e9d64508b0a4.tar.gz ipxe-3e781eb87f7b5bfa638f94234bb5e9d64508b0a4.tar.xz ipxe-3e781eb87f7b5bfa638f94234bb5e9d64508b0a4.zip | |
Merge branch 'xl0-timer'
Diffstat (limited to 'src/include/gpxe')
| -rw-r--r-- | src/include/gpxe/dhcp.h | 1 | ||||
| -rw-r--r-- | src/include/gpxe/tcp.h | 1 | ||||
| -rw-r--r-- | src/include/gpxe/timer.h | 32 |
3 files changed, 32 insertions, 2 deletions
diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 9a9ba7484..6db0e026c 100644 --- a/src/include/gpxe/dhcp.h +++ b/src/include/gpxe/dhcp.h @@ -12,7 +12,6 @@ #include <gpxe/in.h> #include <gpxe/refcnt.h> #include <gpxe/tables.h> -#include <latch.h> struct net_device; struct job_interface; diff --git a/src/include/gpxe/tcp.h b/src/include/gpxe/tcp.h index e2753120c..264ec29b4 100644 --- a/src/include/gpxe/tcp.h +++ b/src/include/gpxe/tcp.h @@ -9,7 +9,6 @@ * */ -#include "latch.h" #include <gpxe/tcpip.h> /** diff --git a/src/include/gpxe/timer.h b/src/include/gpxe/timer.h new file mode 100644 index 000000000..4a4cf5b2f --- /dev/null +++ b/src/include/gpxe/timer.h @@ -0,0 +1,32 @@ +#ifndef GPXE_TIMER_H +#define GPXE_TIMER_H + +#include <stddef.h> + +typedef uint32_t tick_t; + +#define MSECS_IN_SEC (1000) +#define USECS_IN_SEC (1000*1000) +#define USECS_IN_MSEC (1000) + +#define TICKS_PER_SEC USECS_IN_SEC + +tick_t currticks(void); + +void generic_currticks_udelay(unsigned int usecs); + +struct timer { + /* Returns zero on successful initialisation. */ + int (*init) (void); + + /* Return the current time, int mictoseconds since the beginning. */ + tick_t (*currticks) (void); + + /* Sleep for a few useconds. */ + void (*udelay) (unsigned int useconds); +}; + +#define __timer(order) __table (struct timer, timers, order) + +#endif /* GPXE_TIMER_H */ + |
