Skip to content

Commit e6486ea

Browse files
committed
Add comment explaining why calling new-truncate is fine
Signed-off-by: Joe Richey <[email protected]>
1 parent 6cb2ff7 commit e6486ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/structures/idt.rs

+2
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ impl<F> Entry<F> {
741741
let addr = self.pointer_low as u64
742742
| (self.pointer_middle as u64) << 16
743743
| (self.pointer_high as u64) << 32;
744+
// addr is a valid VirtAddr, as the pointer members are either all zero,
745+
// or have been set by set_handler_addr (which takes a VirtAddr).
744746
VirtAddr::new_truncate(addr)
745747
}
746748
}

0 commit comments

Comments
 (0)