Skip to content

Commit 49fa0b8

Browse files
uefi: Fix unsafe_op_in_unsafe_fn in debug module
1 parent 585ae6b commit 49fa0b8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

uefi/src/proto/debug/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl DebugSupport {
9898
}
9999

100100
// Safety: As we've validated the `processor_index`, this should always be safe
101-
(self.register_periodic_callback)(self, processor_index, callback).to_result()
101+
unsafe { (self.register_periodic_callback)(self, processor_index, callback) }.to_result()
102102
}
103103

104104
/// Registers a function to be called when a given processor exception occurs.
@@ -122,8 +122,10 @@ impl DebugSupport {
122122
}
123123

124124
// Safety: As we've validated the `processor_index`, this should always be safe
125-
(self.register_exception_callback)(self, processor_index, callback, exception_type)
126-
.to_result()
125+
unsafe {
126+
(self.register_exception_callback)(self, processor_index, callback, exception_type)
127+
}
128+
.to_result()
127129
}
128130

129131
/// Invalidates processor instruction cache for a memory range for a given `processor_index`.
@@ -144,7 +146,8 @@ impl DebugSupport {
144146

145147
// per the UEFI spec, this call should only return EFI_SUCCESS
146148
// Safety: As we've validated the `processor_index`, this should always be safe
147-
(self.invalidate_instruction_cache)(self, processor_index, start, length).to_result()
149+
unsafe { (self.invalidate_instruction_cache)(self, processor_index, start, length) }
150+
.to_result()
148151
}
149152
}
150153

0 commit comments

Comments
 (0)