4 .type __clone,@function
6 # Save function pointer and argument pointer on new thread stack
7 and $5, $5, -16 # aligning stack to double word
9 sw $4, 0($5) # save function pointer
10 sw $7, 4($5) # save argument pointer
12 # Shuffle (fn,sp,fl,arg,ptid,tls,ctid) to (fl,sp,ptid,tls,ctid)
13 # sys_clone(u64 flags, u64 ustack_base, u64 parent_tidptr, u64 child_tidptr, u64 tls)
28 1: lw $25, 0($sp) # function pointer
29 lw $4, 4($sp) # argument pointer
30 jalr $25 # call the user's function