mailing list of musl libc
 help / color / mirror / code / Atom feed
b2d4f02dd99c5c3e18bb9708b54020320a50c9a4 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
        sd a0, 0(a1)
        sd a3, 8(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:      ld a1, 0(sp)
        ld a0, 8(sp)
        jalr a1

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

solving b2d4f02 ...
found b2d4f02 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/riscv64/clone.s b/src/thread/riscv64/clone.s
new file mode 100644
index 0000000..b2d4f02

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

index at:
100644 b2d4f02dd99c5c3e18bb9708b54020320a50c9a4	src/thread/riscv64/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).