2024-08-21 13:37:50 +03:00
|
|
|
.section .userspace, "ax"
|
2024-03-22 15:33:39 +02:00
|
|
|
|
|
|
|
// stack contains
|
|
|
|
// return address
|
|
|
|
// signal number
|
|
|
|
// signal handler
|
|
|
|
|
|
|
|
.global signal_trampoline
|
|
|
|
signal_trampoline:
|
|
|
|
pushl %ebp
|
|
|
|
movl %esp, %ebp
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
movl 40(%esp), %edi
|
|
|
|
movl 36(%esp), %eax
|
|
|
|
|
2024-04-18 13:32:40 +03:00
|
|
|
// align stack to 16 bytes
|
|
|
|
movl %esp, %ebx
|
|
|
|
andl $0x0F, %ebx
|
|
|
|
subl %ebx, %esp
|
|
|
|
|
2024-03-22 15:33:39 +02:00
|
|
|
subl $12, %esp
|
|
|
|
pushl %edi
|
|
|
|
call *%eax
|
|
|
|
addl $16, %esp
|
|
|
|
|
2024-04-18 13:32:40 +03:00
|
|
|
// restore stack
|
|
|
|
addl %ebx, %esp
|
2024-03-22 15:33:39 +02:00
|
|
|
popa
|
|
|
|
|
|
|
|
leave
|
|
|
|
addl $8, %esp
|
|
|
|
|
|
|
|
ret
|