refactor: full rewrite of signal feature
[lunaix-os.git] / lunaix-os / usr / libc / arch / i386 / trampoline.S
diff --git a/lunaix-os/usr/libc/arch/i386/trampoline.S b/lunaix-os/usr/libc/arch/i386/trampoline.S
new file mode 100644 (file)
index 0000000..9261e4b
--- /dev/null
@@ -0,0 +1,20 @@
+#include <lunaix/syscallid.h>
+
+.section .text
+    .global sigtrampoline
+    sigtrampoline:
+        movl %esp, %eax
+        andl $0xfffffff0, %esp
+        pushl %eax
+        
+        leal 4(%eax), %eax
+        pushl %eax
+        pushl $0
+        pushl -4(%eax)
+        call sig_dohandling
+
+        addl $12, %esp
+        
+        movl $__SYSCALL_sigreturn, %eax
+        popl %ebx
+        int $33
\ No newline at end of file