]> Joshua Wise's Git repositories - netwatch.git/blob - include/msr.h
0bed091a4a289a6b2d82f8df1734ed160ba9c7dd
[netwatch.git] / include / msr.h
1 #ifndef _MSR_H
2 #define _MSR_H
3
4 #define WRMSR(ad, da) \
5         do { \
6                 unsigned long __a = (ad); \
7                 unsigned long long __d = (da); \
8                 asm volatile("wrmsr" : : "c" (__a), "A" (__d)); \
9         } while (0)
10 #define RDMSR(ad) \
11         ({ \
12                 unsigned long __a = (ad); \
13                 unsigned long long __d; \
14                 asm volatile("rdmsr" : "=A" (__d) : "c" (__a)); \
15                 __d; \
16         })
17
18 #endif
This page took 0.016287 seconds and 2 git commands to generate.