1570af302Sopenharmony_ci// __clone(func, stack, flags, arg, ptid, tls, ctid) 2570af302Sopenharmony_ci// x0, x1, w2, x3, x4, x5, x6 3570af302Sopenharmony_ci 4570af302Sopenharmony_ci// syscall(SYS_clone, flags, stack, ptid, tls, ctid) 5570af302Sopenharmony_ci// x8, x0, x1, x2, x3, x4 6570af302Sopenharmony_ci 7570af302Sopenharmony_ci.global __clone 8570af302Sopenharmony_ci.hidden __clone 9570af302Sopenharmony_ci.type __clone,%function 10570af302Sopenharmony_ci__clone: 11570af302Sopenharmony_ci // align stack and save func,arg 12570af302Sopenharmony_ci and x1,x1,#-16 13570af302Sopenharmony_ci stp x0,x3,[x1,#-16]! 14570af302Sopenharmony_ci 15570af302Sopenharmony_ci // syscall 16570af302Sopenharmony_ci uxtw x0,w2 17570af302Sopenharmony_ci mov x2,x4 18570af302Sopenharmony_ci mov x3,x5 19570af302Sopenharmony_ci mov x4,x6 20570af302Sopenharmony_ci mov x8,#220 // SYS_clone 21570af302Sopenharmony_ci svc #0 22570af302Sopenharmony_ci 23570af302Sopenharmony_ci cbz x0,1f 24570af302Sopenharmony_ci // parent 25570af302Sopenharmony_ci ret 26570af302Sopenharmony_ci // child 27570af302Sopenharmony_ci1: ldp x1,x0,[sp],#16 28570af302Sopenharmony_ci blr x1 29570af302Sopenharmony_ci mov x8,#93 // SYS_exit 30570af302Sopenharmony_ci svc #0 31