Skip to content

Commit 2c9a807

Browse files
authored
Merge pull request #354 from kevinaboos/make_handler_addr_pub
Make `Entry::handler_addr()` a public method
2 parents 27032e3 + e6486ea commit 2c9a807

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/structures/idt.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,15 @@ impl<F> Entry<F> {
733733
&mut self.options
734734
}
735735

736+
/// Returns the virtual address of this IDT entry's handler function.
736737
#[inline]
737-
fn handler_addr(&self) -> u64 {
738-
self.pointer_low as u64
738+
pub fn handler_addr(&self) -> VirtAddr {
739+
let addr = self.pointer_low as u64
739740
| (self.pointer_middle as u64) << 16
740-
| (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)
741745
}
742746
}
743747

0 commit comments

Comments
 (0)