[tcp] Allow out-of-order receive queue to be discarded
[gpxe.git] / src / arch / i386 / include / gpxe / bios_timer.h
blobed9df5225a1e717a11ffa1226218a1ad2079a5a5
1 #ifndef _GPXE_BIOS_TIMER_H
2 #define _GPXE_BIOS_TIMER_H
4 /** @file
6 * BIOS timer
8 */
10 FILE_LICENCE ( GPL2_OR_LATER );
12 #ifdef TIMER_PCBIOS
13 #define TIMER_PREFIX_pcbios
14 #else
15 #define TIMER_PREFIX_pcbios __pcbios_
16 #endif
18 #include <gpxe/timer2.h>
20 /**
21 * Delay for a fixed number of microseconds
23 * @v usecs Number of microseconds for which to delay
25 static inline __always_inline void
26 TIMER_INLINE ( pcbios, udelay ) ( unsigned long usecs ) {
27 /* BIOS timer is not high-resolution enough for udelay(), so
28 * we use timer2
30 timer2_udelay ( usecs );
33 /**
34 * Get number of ticks per second
36 * @ret ticks_per_sec Number of ticks per second
38 static inline __always_inline unsigned long
39 TIMER_INLINE ( pcbios, ticks_per_sec ) ( void ) {
40 /* BIOS timer ticks over at 18.2 ticks per second */
41 return 18;
44 #endif /* _GPXE_BIOS_TIMER_H */