2 * Access to machine-specific registers (available on 586 and better only)
3 * Note: the rd* operations modify the parameters directly (without using
4 * pointer indirection), this allows gcc to optimize better
7 #define rdmsr(msr,val1,val2) \
8 __asm__ __volatile__("rdmsr" \
9 : "=a" (val1), "=d" (val2) \
12 #define wrmsr(msr,val1,val2) \
13 __asm__ __volatile__("wrmsr" \
15 : "c" (msr), "a" (val1), "d" (val2))
17 #define rdtsc(low,high) \
18 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
21 __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
23 #define rdtscll(val) \
24 __asm__ __volatile__ ("rdtsc" : "=A" (val))
26 #define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
28 #define rdpmc(counter,low,high) \
29 __asm__ __volatile__("rdpmc" \
30 : "=a" (low), "=d" (high) \