Skip to content

Commit 6cb2ff7

Browse files
committed
Return a VirtAddr from Entry::handler_addr().
1 parent b87ecd0 commit 6cb2ff7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/structures/idt.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,12 +735,13 @@ impl<F> Entry<F> {
735735
&mut self.options
736736
}
737737

738-
/// Returns the virtual address of this IDT entry's handler function as a `u64`.
738+
/// Returns the virtual address of this IDT entry's handler function.
739739
#[inline]
740-
pub fn handler_addr(&self) -> u64 {
741-
self.pointer_low as u64
740+
pub fn handler_addr(&self) -> VirtAddr {
741+
let addr = self.pointer_low as u64
742742
| (self.pointer_middle as u64) << 16
743-
| (self.pointer_high as u64) << 32
743+
| (self.pointer_high as u64) << 32;
744+
VirtAddr::new_truncate(addr)
744745
}
745746
}
746747

0 commit comments

Comments
 (0)