rdtsc_timer.h File Reference

RDTSC timer. More...

Go to the source code of this file.

Defines

#define TIMER_PREFIX_rdtsc   __rdtsc_
#define TSC_SHIFT   8
 RDTSC values can easily overflow an unsigned long.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static __always_inline
unsigned long 
TIMER_INLINE (rdtsc, currticks)(void)
 Get current system time in ticks.


Detailed Description

RDTSC timer.

Definition in file rdtsc_timer.h.


Define Documentation

#define TIMER_PREFIX_rdtsc   __rdtsc_

Definition at line 15 of file rdtsc_timer.h.

#define TSC_SHIFT   8

RDTSC values can easily overflow an unsigned long.

We discard the low-order bits in order to obtain sensibly-scaled values.

Definition at line 22 of file rdtsc_timer.h.

Referenced by rdtsc_udelay(), and TIMER_INLINE().


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

static __always_inline unsigned long TIMER_INLINE ( rdtsc  ,
currticks   
) [inline, static]

Get current system time in ticks.

Return values:
ticks Current time, in ticks

Definition at line 30 of file rdtsc_timer.h.

References __asm__(), and TSC_SHIFT.

00030                                            {
00031         unsigned long ticks;
00032 
00033         __asm__ __volatile__ ( "rdtsc\n\t"
00034                                "shrdl %1, %%edx, %%eax\n\t"
00035                                : "=a" ( ticks ) : "i" ( TSC_SHIFT ) : "edx" );
00036         return ticks;
00037 }


Generated on Tue Apr 6 20:01:12 2010 for gPXE by  doxygen 1.5.7.1