3 .type __clone, %function
5 # int clone(fn, stack, flags, arg, ptid, tls, ctid)
9 # tid = syscall(SYS_clone,c,b,e,f,g);
10 # if (!tid) syscall(SYS_exit, a(d));
16 # store non-volatile regs r30, r31 on stack in order to put our
17 # start func and its arg there
21 # save r3 (func) into r30, and r6(arg) into r31
25 #move c into first arg
32 # move syscall number into r0
37 # check for syscall error
38 bns+ 1f # jump to label 1 if no summary overflow.
40 neg 3, 3 #negate the result (errno)
42 # compare sc result with 0
45 # if not 0, jump to end
48 #else: we're the child
49 #call funcptr: move arg (d) into r3
51 #move r30 (funcptr) into CTR reg
55 # mov SYS_exit into r0 (the exit param is already in r3)