summaryrefslogtreecommitdiffhomepage
path: root/src/thread/nt64/syscall_cp.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/nt64/syscall_cp.s')
-rw-r--r--src/thread/nt64/syscall_cp.s29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/thread/nt64/syscall_cp.s b/src/thread/nt64/syscall_cp.s
new file mode 100644
index 0000000..b8b7039
--- /dev/null
+++ b/src/thread/nt64/syscall_cp.s
@@ -0,0 +1,29 @@
+.text
+.globl __syscall_cp_asm
+.globl __cp_begin
+.globl __cp_end
+
+__syscall_cp_asm:
+__cp_begin:
+ movq (%rcx), %rcx /* check content of ptr */
+ test %ecx, %ecx
+ jnz __cancel /* thread is pending cancellation */
+
+ movq %rdx, %rcx/* move water */
+ movq %r8, %rdx/* from one glass */
+ movq %r9, %r8 /* to another */
+ movq 0x28(%rsp), %r9
+
+ movq 0x30(%rsp),%rax
+ movq %rax, 0x28(%rsp)
+
+ movq 0x38(%rsp),%r10
+ movq %r10, 0x30(%rsp)
+
+ movq 0x40(%rsp),%r10
+ movq %r10, 0x38(%rsp)
+
+ jmp __syscall
+
+__cp_end:
+ ret