Skip to content

Commit 1e9af54

Browse files
committed
IDT: Consider #CP and #HV on Index and IndexMut
Include the cases for #CP (cp_protection_exception) and #HV (hv_injection_exception) in the Index and IndexMut implementations. Signed-off-by: Carlos Bilbao <[email protected]>
1 parent 9f2e615 commit 1e9af54

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/structures/idt.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,10 @@ impl Index<usize> for InterruptDescriptorTable {
586586
16 => &self.x87_floating_point,
587587
19 => &self.simd_floating_point,
588588
20 => &self.virtualization,
589+
28 => &self.hv_injection_exception,
589590
i @ 32..=255 => &self.interrupts[i - 32],
590-
i @ 15 | i @ 31 | i @ 21..=28 => panic!("entry {} is reserved", i),
591-
i @ 8 | i @ 10..=14 | i @ 17 | i @ 29 | i @ 30 => {
591+
i @ 15 | i @ 31 | i @ 21..=27 => panic!("entry {} is reserved", i),
592+
i @ 8 | i @ 10..=14 | i @ 17 | i @ 21 | i @ 29 | i @ 30 => {
592593
panic!("entry {} is an exception with error code", i)
593594
}
594595
i @ 18 => panic!("entry {} is an diverging exception (must not return)", i),
@@ -617,9 +618,10 @@ impl IndexMut<usize> for InterruptDescriptorTable {
617618
16 => &mut self.x87_floating_point,
618619
19 => &mut self.simd_floating_point,
619620
20 => &mut self.virtualization,
621+
28 => &mut self.hv_injection_exception,
620622
i @ 32..=255 => &mut self.interrupts[i - 32],
621-
i @ 15 | i @ 31 | i @ 21..=28 => panic!("entry {} is reserved", i),
622-
i @ 8 | i @ 10..=14 | i @ 17 | i @ 29 | i @ 30 => {
623+
i @ 15 | i @ 31 | i @ 21..=27 => panic!("entry {} is reserved", i),
624+
i @ 8 | i @ 10..=14 | i @ 17 | i @ 21 | i @ 29 | i @ 30 => {
623625
panic!("entry {} is an exception with error code", i)
624626
}
625627
i @ 18 => panic!("entry {} is an diverging exception (must not return)", i),

0 commit comments

Comments
 (0)