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 */
6
7 #define rdmsr(msr,val1,val2) \
8 __asm__ __volatile__("rdmsr" \
9 : "=a" (val1), "=d" (val2) \
10 : "c" (msr))
11
12 #define wrmsr(msr,val1,val2) \
13 __asm__ __volatile__("wrmsr" \
14 : /* no outputs */ \
15 : "c" (msr), "a" (val1), "d" (val2))
16
17 #define rdtsc(low,high) \
18 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
19
20 #define rdtscl(low) \
21 __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
22
23 #define rdtscll(val) \
24 __asm__ __volatile__ ("rdtsc" : "=A" (val))
25
26 #define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
27
28 #define rdpmc(counter,low,high) \
29 __asm__ __volatile__("rdpmc" \
30 : "=a" (low), "=d" (high) \
31 : "c" (counter))
32
33 /* symbolic names for some interesting MSRs */
34 #define MSR_IA32_PLATFORM_ID 0x17
35 #define MSR_IA32_UCODE_WRITE 0x79
36 #define MSR_IA32_UCODE_REV 0x8B
37
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.