summaryrefslogtreecommitdiff
path: root/src/thread/i386
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/i386')
-rw-r--r--src/thread/i386/syscall_cp.s36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/thread/i386/syscall_cp.s b/src/thread/i386/syscall_cp.s
new file mode 100644
index 00000000..6f98a779
--- /dev/null
+++ b/src/thread/i386/syscall_cp.s
@@ -0,0 +1,36 @@
+.text
+.global __syscall_cp_asm
+.type __syscall_cp_asm,%function
+__syscall_cp_asm:
+ pushl %ebx
+ pushl %esi
+ pushl %edi
+ pushl %ebp
+ leal 20(%esp),%ebp
+ call 1f
+1: popl %eax
+ movl (%ebp),%ecx
+ addl $[1f-1b],%eax
+ movl %eax,4(%ecx)
+ movl %esp,(%ecx)
+ movl 8(%ecx),%eax
+ testl %eax,%eax
+ jnz 2f
+ movl 4(%ebp),%eax
+ movl 8(%ebp),%ebx
+ movl 12(%ebp),%ecx
+ movl 16(%ebp),%edx
+ movl 20(%ebp),%esi
+ movl 24(%ebp),%edi
+ movl 28(%ebp),%ebp
+1: int $128
+ popl %ebp
+ popl %edi
+ popl %esi
+ popl %ebx
+ ret
+2: xorl %eax,%eax
+ movl %eax,4(%ecx)
+ movl %eax,(%ecx)
+ pushl $-1
+ call pthread_exit