]> Joshua Wise's Git repositories - netwatch.git/blobdiff - include/msr.h
Enable caching while in SMM.
[netwatch.git] / include / msr.h
diff --git a/include/msr.h b/include/msr.h
new file mode 100644 (file)
index 0000000..0bed091
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _MSR_H
+#define _MSR_H
+
+#define WRMSR(ad, da) \
+       do { \
+               unsigned long __a = (ad); \
+               unsigned long long __d = (da); \
+               asm volatile("wrmsr" : : "c" (__a), "A" (__d)); \
+       } while (0)
+#define RDMSR(ad) \
+       ({ \
+               unsigned long __a = (ad); \
+               unsigned long long __d; \
+               asm volatile("rdmsr" : "=A" (__d) : "c" (__a)); \
+               __d; \
+       })
+
+#endif
This page took 0.018353 seconds and 4 git commands to generate.