bios_timer.h

Go to the documentation of this file.
00001 #ifndef _GPXE_BIOS_TIMER_H
00002 #define _GPXE_BIOS_TIMER_H
00003 
00004 /** @file
00005  *
00006  * BIOS timer
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER );
00011 
00012 #ifdef TIMER_PCBIOS
00013 #define TIMER_PREFIX_pcbios
00014 #else
00015 #define TIMER_PREFIX_pcbios __pcbios_
00016 #endif
00017 
00018 #include <gpxe/timer2.h>
00019 
00020 /**
00021  * Delay for a fixed number of microseconds
00022  *
00023  * @v usecs             Number of microseconds for which to delay
00024  */
00025 static inline __always_inline void
00026 TIMER_INLINE ( pcbios, udelay ) ( unsigned long usecs ) {
00027         /* BIOS timer is not high-resolution enough for udelay(), so
00028          * we use timer2
00029          */
00030         timer2_udelay ( usecs );
00031 }
00032 
00033 /**
00034  * Get number of ticks per second
00035  *
00036  * @ret ticks_per_sec   Number of ticks per second
00037  */
00038 static inline __always_inline unsigned long
00039 TIMER_INLINE ( pcbios, ticks_per_sec ) ( void ) {
00040         /* BIOS timer ticks over at 18.2 ticks per second */
00041         return 18;
00042 }
00043 
00044 #endif /* _GPXE_BIOS_TIMER_H */

Generated on Tue Apr 6 20:00:50 2010 for gPXE by  doxygen 1.5.7.1