From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/thread/x32/clone.s | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/thread/x32/clone.s (limited to 'src/thread/x32/clone.s') diff --git a/src/thread/x32/clone.s b/src/thread/x32/clone.s new file mode 100644 index 0000000..b870880 --- /dev/null +++ b/src/thread/x32/clone.s @@ -0,0 +1,26 @@ +.text +.global __clone +.hidden __clone +.type __clone,@function +__clone: + movl $0x40000038,%eax /* SYS_clone */ + mov %rdi,%r11 + mov %rdx,%rdi + mov %r8,%rdx + mov %r9,%r8 + mov 8(%rsp),%r10 + mov %r11,%r9 + and $-16,%rsi + sub $8,%rsi + mov %rcx,(%rsi) + syscall + test %eax,%eax + jnz 1f + xor %ebp,%ebp + pop %rdi + call *%r9 + mov %eax,%edi + movl $0x4000003c,%eax /* SYS_exit */ + syscall + hlt +1: ret -- cgit v1.2.3