.global task_move_stack
.global task_lock
.global task_unlock
+.global _task_sig_stub
task_prepare:
/*
call spinlock_unlock
subl $OFFSET_TASK_LOCK, 4(%esp)
ret
+
+ /*
+ * task_sig_stub is used to execute a signal handler while returning
+ * from kernel to user space. The stack frame has to look like this:
+ *
+ * | ... |
+ * +----------------+
+ * | struct siginfo | the address of this is the `si' argument
+ * | data | this is the `data' argument
+ * | signal | this is the `sig' argument
+ * | handler | (*sa_sigaction)(int sig, siginfo_t *si, void *data)
+ * | EIP | the original return address of the interrupt
+ * +----------------+
+ */
+_task_sig_stub:
+ pusha
+ movl 36(%esp), %edx
+ movl 40(%esp), %eax
+ movl 44(%esp), %ecx
+ leal 48(%esp), %ebx
+ pushl %ecx
+ pushl %ebx
+ pushl %eax
+ call *%edx
+ addl $12, %esp
+ popa
+ ret