#x86-64 #msr

msru

A Rust-safe library for interracting with Model Specific Registers in user-space

2 unstable releases

0.2.0 May 25, 2023
0.1.0 May 19, 2023

#3 in #msr

Download history 478/week @ 2024-07-25 382/week @ 2024-08-01 412/week @ 2024-08-08 786/week @ 2024-08-15 908/week @ 2024-08-22 1078/week @ 2024-08-29 801/week @ 2024-09-05 658/week @ 2024-09-12 524/week @ 2024-09-19 531/week @ 2024-09-26 565/week @ 2024-10-03 319/week @ 2024-10-10 535/week @ 2024-10-17 538/week @ 2024-10-24 763/week @ 2024-10-31 384/week @ 2024-11-07

2,244 downloads per month
Used in 3 crates

Apache-2.0

7KB
71 lines

msru

msru provides a Rust-friendly interface for x86_64 CPU MSRs (Model Specific Registers). It allows you to read and write to MSRs via a specified CPU msr device file (/dev/cpu/{cpu_number}/msr).

Installation

Add the following line to your Cargo.toml file:

[dependencies]
msru = "0.2.0"

Usage

use msru::Msr;

// X86_64 SYSCFG MSR
let msr: Msr = Msr::new(0xC0010010, 0)?;

let raw_value: u64 = msr.read()?;

// ...

lib.rs:

As most of the existing crates require kernel-mode, this provides a Rust-friendly interface for reading and writing to MSRs while in user-space. This does require the msr kernel module to be loaded.

Currently this crate only supports Linux.

No runtime deps