diff --git a/src/instructions/tlb.rs b/src/instructions/tlb.rs index 8558f5f5..3f5c4467 100644 --- a/src/instructions/tlb.rs +++ b/src/instructions/tlb.rs @@ -30,7 +30,7 @@ pub fn flush_all() { /// The Invalidate PCID Command to execute. #[derive(Debug)] -pub enum InvPicdCommand { +pub enum InvPcidCommand { /// The logical processor invalidates mappings—except global translations—for the linear address and PCID specified. Address(VirtAddr, Pcid), @@ -44,6 +44,11 @@ pub enum InvPicdCommand { AllExceptGlobal, } +// TODO: Remove this in the next breaking release. +#[deprecated = "please use `InvPcidCommand` instead"] +#[doc(hidden)] +pub type InvPicdCommand = InvPcidCommand; + /// The INVPCID descriptor comprises 128 bits and consists of a PCID and a linear address. /// For INVPCID type 0, the processor uses the full 64 bits of the linear address even outside 64-bit mode; the linear address is not used for other INVPCID types. #[repr(C)] @@ -93,7 +98,7 @@ impl fmt::Display for PcidTooBig { /// /// This function is unsafe as it requires CPUID.(EAX=07H, ECX=0H):EBX.INVPCID to be 1. #[inline] -pub unsafe fn flush_pcid(command: InvPicdCommand) { +pub unsafe fn flush_pcid(command: InvPcidCommand) { let mut desc = InvpcidDescriptor { pcid: 0, address: 0, @@ -101,17 +106,17 @@ pub unsafe fn flush_pcid(command: InvPicdCommand) { let kind: u64; match command { - InvPicdCommand::Address(addr, pcid) => { + InvPcidCommand::Address(addr, pcid) => { kind = 0; desc.pcid = pcid.value().into(); desc.address = addr.as_u64() } - InvPicdCommand::Single(pcid) => { + InvPcidCommand::Single(pcid) => { kind = 1; desc.pcid = pcid.0.into() } - InvPicdCommand::All => kind = 2, - InvPicdCommand::AllExceptGlobal => kind = 3, + InvPcidCommand::All => kind = 2, + InvPcidCommand::AllExceptGlobal => kind = 3, } unsafe {