Skip to content

Commit ec65a22

Browse files
committed
Add safety explanation
Signed-off-by: Joe Richey <[email protected]>
1 parent 6e07d7a commit ec65a22

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/instructions/interrupts.rs

+6
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ pub fn int3() {
154154
}
155155

156156
/// Generate a software interrupt by invoking the `int` instruction.
157+
///
158+
/// ## Safety
159+
/// Invoking an arbitrary interrupt is unsafe. It can cause your system to
160+
/// crash if you invoke a double-fault (#8) or machine-check (#18) exception.
161+
/// It can also cause memory/register corruption depending on the interrupt
162+
/// implementation (if it expects values/pointers to be passed in registers).
157163
#[inline]
158164
#[cfg(feature = "inline_asm")]
159165
pub unsafe fn software_interrupt<const ID: u8>() {

0 commit comments

Comments
 (0)