mailing list of musl libc
 help / color / mirror / code / Atom feed
30126d2c71da771cfa5fe41a76a19747aa1eae58 blob 690 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
# __clone(func, stack, flags, arg, ptid, tls, ctid)
#           a0,    a1,    a2,  a3,   a4,  a5,   a6

# syscall(SYS_clone, flags, stack, ptid, tls, ctid)
#                a7     a0,    a1,   a2,  a3,   a4

.global __clone
.type  __clone, %function
__clone:
        # Save func and arg to stack
        addi a1, a1, -16
        sw a0, 0(a1)
        sw a3, 4(a1)

        # Call SYS_clone
        mv a0, a2
        mv a2, a4
        mv a3, a5
        mv a4, a6
        li a7, 220 # SYS_clone
        scall

        beqz a0, 1f
        # Parent
        ret

        # Child
1:      lw a1, 0(sp)
        lw a0, 4(sp)
        jalr a1

        # Exit
        li a7, 93 # SYS_exit
        scall
debug log:

solving 30126d2 ...
found 30126d2 in https://inbox.vuxu.org/musl/20180928022404.GQ17995@brightrain.aerifal.cx/

applying [1/1] https://inbox.vuxu.org/musl/20180928022404.GQ17995@brightrain.aerifal.cx/
diff --git a/src/thread/riscv32/clone.s b/src/thread/riscv32/clone.s
new file mode 100644
index 0000000..30126d2

Checking patch src/thread/riscv32/clone.s...
Applied patch src/thread/riscv32/clone.s cleanly.

index at:
100644 30126d2c71da771cfa5fe41a76a19747aa1eae58	src/thread/riscv32/clone.s

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).