00001 #ifndef _I386_LIB_H
00002 #define _I386_LIB_H
00003
00004
00005 #define rdtsc(low,high) \
00006 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
00007 #define rdtscl(low) \
00008 __asm__ __volatile__("rdtsc" : "=a" (low) : : "edx")
00009 #define rdtscll(val) \
00010 __asm__ __volatile__("rdtsc" : "=A" (val))
00011
00012 extern inline unsigned long long getfast_l(void)
00013 {
00014 register unsigned int l, h ;
00015
00016 __asm__ __volatile__("rdtsc" : "=a" (l), "=d" (h)) ;
00017
00018 return ((unsigned long long)h<<32) | l ;
00019
00020 }
00021
00022 extern inline unsigned int getfast(void)
00023 {
00024 register unsigned int l ;
00025
00026 __asm__ __volatile__("rdtsc" : "=a" (l) : : "edx" ) ;
00027
00028 return l ;
00029
00030 }
00031
00032 #endif