minimal_rt/arch/x86_64/
enlightened_panic.rsuse crate::arch::x86_64::msr::write_msr;
use hvdef::HV_X64_MSR_GUEST_CRASH_CTL;
use hvdef::HV_X64_MSR_GUEST_CRASH_P0;
use hvdef::HV_X64_MSR_GUEST_CRASH_P1;
use hvdef::HV_X64_MSR_GUEST_CRASH_P2;
use hvdef::HV_X64_MSR_GUEST_CRASH_P3;
use hvdef::HV_X64_MSR_GUEST_CRASH_P4;
const REGS: [u32; 6] = [
HV_X64_MSR_GUEST_CRASH_P0,
HV_X64_MSR_GUEST_CRASH_P1,
HV_X64_MSR_GUEST_CRASH_P2,
HV_X64_MSR_GUEST_CRASH_P3,
HV_X64_MSR_GUEST_CRASH_P4,
HV_X64_MSR_GUEST_CRASH_CTL,
];
pub unsafe fn write_crash_reg(index: usize, value: u64) {
unsafe {
write_msr(REGS[index], value);
}
}