virtfw-libhw 0.2.1

library for direct hardware access
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#![cfg(target_arch = "x86_64")]

use core::arch::asm;

pub fn rdmsr(msr: u32) -> u64 {
    let eax: u32;
    let edx: u32;

    unsafe {
        asm!("rdmsr", in("ecx") msr, out("eax") eax, out("edx") edx, options(att_syntax));
    }
    (eax as u64) | ((edx as u64) << 32)
}