Skip to content

Commit

Permalink
Merge pull request #11 from kennystrawnmusic/master
Browse files Browse the repository at this point in the history
Make the errors mapping table entries less cryptic
  • Loading branch information
kwzhao authored Aug 3, 2022
2 parents 8cbcebd + fe40255 commit 5c43eac
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/lapic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,20 @@ impl LocalApic {
}

unsafe fn remap_lvt_entries(&mut self) {
self.regs.set_lvt_timer_bit_range(
LVT_TIMER_VECTOR,
self.timer_vector as u32,
);
self.regs.set_lvt_error_bit_range(
LVT_ERROR_VECTOR,
self.error_vector as u32,
);
self.regs
.set_sivr_bit_range(SIVR_VECTOR, self.spurious_vector as u32);
if self.timer_vector > 255 || self.error_vector > 255 || self.spurious_vector > 255 {
panic!("Vector entry too large: timer, error, and spurious vectors must be 8 bits in length");
} else {
self.regs.set_lvt_timer_bit_range(
LVT_TIMER_VECTOR,
self.timer_vector as u32,
);
self.regs.set_lvt_error_bit_range(
LVT_ERROR_VECTOR,
self.error_vector as u32,
);
self.regs
.set_sivr_bit_range(SIVR_VECTOR, self.spurious_vector as u32);
}
}

unsafe fn configure_timer(&mut self) {
Expand Down

0 comments on commit 5c43eac

Please sign in to comment.