Skip to content

Commit 3943178

Browse files
authored
Merge pull request #509 from rust-osdev/fix/inv-picd-command
fix typo in "InvPicdCommand"
2 parents 7525088 + 199d614 commit 3943178

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/instructions/tlb.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn flush_all() {
3030

3131
/// The Invalidate PCID Command to execute.
3232
#[derive(Debug)]
33-
pub enum InvPicdCommand {
33+
pub enum InvPcidCommand {
3434
/// The logical processor invalidates mappings—except global translations—for the linear address and PCID specified.
3535
Address(VirtAddr, Pcid),
3636

@@ -44,6 +44,11 @@ pub enum InvPicdCommand {
4444
AllExceptGlobal,
4545
}
4646

47+
// TODO: Remove this in the next breaking release.
48+
#[deprecated = "please use `InvPcidCommand` instead"]
49+
#[doc(hidden)]
50+
pub type InvPicdCommand = InvPcidCommand;
51+
4752
/// The INVPCID descriptor comprises 128 bits and consists of a PCID and a linear address.
4853
/// 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.
4954
#[repr(C)]
@@ -93,25 +98,25 @@ impl fmt::Display for PcidTooBig {
9398
///
9499
/// This function is unsafe as it requires CPUID.(EAX=07H, ECX=0H):EBX.INVPCID to be 1.
95100
#[inline]
96-
pub unsafe fn flush_pcid(command: InvPicdCommand) {
101+
pub unsafe fn flush_pcid(command: InvPcidCommand) {
97102
let mut desc = InvpcidDescriptor {
98103
pcid: 0,
99104
address: 0,
100105
};
101106

102107
let kind: u64;
103108
match command {
104-
InvPicdCommand::Address(addr, pcid) => {
109+
InvPcidCommand::Address(addr, pcid) => {
105110
kind = 0;
106111
desc.pcid = pcid.value().into();
107112
desc.address = addr.as_u64()
108113
}
109-
InvPicdCommand::Single(pcid) => {
114+
InvPcidCommand::Single(pcid) => {
110115
kind = 1;
111116
desc.pcid = pcid.0.into()
112117
}
113-
InvPicdCommand::All => kind = 2,
114-
InvPicdCommand::AllExceptGlobal => kind = 3,
118+
InvPcidCommand::All => kind = 2,
119+
InvPcidCommand::AllExceptGlobal => kind = 3,
115120
}
116121

117122
unsafe {

0 commit comments

Comments
 (0)