We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 27032e3 + e6486ea commit 2c9a807Copy full SHA for 2c9a807
src/structures/idt.rs
@@ -733,11 +733,15 @@ impl<F> Entry<F> {
733
&mut self.options
734
}
735
736
+ /// Returns the virtual address of this IDT entry's handler function.
737
#[inline]
- fn handler_addr(&self) -> u64 {
738
- self.pointer_low as u64
+ pub fn handler_addr(&self) -> VirtAddr {
739
+ let addr = self.pointer_low as u64
740
| (self.pointer_middle as u64) << 16
- | (self.pointer_high as u64) << 32
741
+ | (self.pointer_high as u64) << 32;
742
+ // addr is a valid VirtAddr, as the pointer members are either all zero,
743
+ // or have been set by set_handler_addr (which takes a VirtAddr).
744
+ VirtAddr::new_truncate(addr)
745
746
747
0 commit comments