We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4fc44a6 + e7f53ac commit fb5416cCopy full SHA for fb5416c
src/structures/idt.rs
@@ -831,15 +831,19 @@ impl<F: HandlerFuncType> Entry<F> {
831
}
832
833
/// A common trait for all handler functions usable in [`Entry`].
834
-pub trait HandlerFuncType {
+///
835
+/// # Safety
836
837
+/// Implementors have to ensure that `to_virt_addr` returns a valid address.
838
+pub unsafe trait HandlerFuncType {
839
/// Get the virtual address of the handler function.
840
fn to_virt_addr(self) -> VirtAddr;
841
842
843
macro_rules! impl_handler_func_type {
844
($f:ty) => {
845
#[cfg(feature = "abi_x86_interrupt")]
- impl HandlerFuncType for $f {
846
+ unsafe impl HandlerFuncType for $f {
847
#[inline]
848
fn to_virt_addr(self) -> VirtAddr {
849
VirtAddr::new(self as u64)
0 commit comments