diff --git a/lib/runtime/src/process/signal.rs b/lib/runtime/src/process/signal.rs index d822df8e..8980236a 100644 --- a/lib/runtime/src/process/signal.rs +++ b/lib/runtime/src/process/signal.rs @@ -164,6 +164,8 @@ pub fn setup_signal_full(size: usize) -> Result<(), Error> { // TODO #[cfg(any(target_arch = "x86", rust_analyzer))] mod imp { + use super::common_signal_entry; + // i686 is a bit tricky: cdecl ABI requires the arguments to be passed on the stack, while // the kernel does the easy thing and just puts it into %eax, so a fixup needs to be done // before entering a proper handler. The wrapper also aligns the stack nicely. @@ -172,9 +174,13 @@ mod imp { // %eax - SignalEntryData pointer core::arch::naked_asm!( r#" - jmp . + // Align the stack + and $~0xF, %esp + push %eax + call {entry} "#, - options(att_syntax) + options(att_syntax), + entry = sym common_signal_entry ); } }