summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc')
-rw-r--r--dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc b/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc
index 66f27c24..2fc18e2f 100644
--- a/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc
+++ b/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc
@@ -16,6 +16,11 @@
*/
namespace Kernel::HAL {
+Void hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) noexcept {
+ if (!lo || !hi) return;
+ asm volatile("rdmsr" : "=a"(*lo), "=d"(*hi) : "c"(msr));
+}
+
Void hal_set_msr(UInt32 msr, UInt32 lo, UInt32 hi) noexcept {
asm volatile("wrmsr" : : "a"(lo), "d"(hi), "c"(msr));
}