Megacommit to move some memory code into kernel crate

This commit is contained in:
2025-02-28 02:13:50 +00:00
parent 192100be7a
commit 92fe618a99
16 changed files with 106 additions and 323 deletions
+4 -4
View File
@@ -3,11 +3,11 @@ pub mod model_specific_registers {
use spin::Lazy;
use x86_64::registers::model_specific::Msr;
const CPUID_FLAG_MSR: u32 = 1 << 5;
static EDX: Lazy<u32> = Lazy::new(|| unsafe { __cpuid(1).edx });
const _CPUID_FLAG_MSR: u32 = 1 << 5;
static _EDX: Lazy<u32> = Lazy::new(|| unsafe { __cpuid(1).edx });
pub fn cpu_has_msr() -> bool {
*EDX & CPUID_FLAG_MSR != 0
pub fn _cpu_has_msr() -> bool {
*_EDX & _CPUID_FLAG_MSR != 0
}
pub fn cpu_get_msr(msr: u32, value: &mut u64) {