* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / include / asm-i386 / msr.h
blob515a8dc5ccb218f5043cadf52ca2985e3b840134
1 /*
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
5 */
7 #define rdmsr(msr,val1,val2) \
8 __asm__ __volatile__("rdmsr" \
9 : "=a" (val1), "=d" (val2) \
10 : "c" (msr))
12 #define wrmsr(msr,val1,val2) \
13 __asm__ __volatile__("wrmsr" \
14 : /* no outputs */ \
15 : "c" (msr), "a" (val1), "d" (val2))
17 #define rdtsc(low,high) \
18 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
20 #define rdtscl(low) \
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) \
31 : "c" (counter))