mailing list of musl libc
 help / color / mirror / code / Atom feed
a1ac988cd79177a320e5e8de474900825009d7ee blob 819 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
 
#__clone(func, stack, flags, arg, ptid, tls, ctid)
#         a0,    a1,   a2,    a3,  a4,  a5,   a6
# sys_clone(flags, stack, ptid, ctid, tls)
#            a0,    a1,   a2,    a3,  a4

.global	__clone
.hidden __clone
.type	__clone,@function
__clone:
	# Save function pointer and argument pointer on new thread stack
	addi.d	$a1, $a1, -16
	st.d	$a0, $a1, 0	# save function pointer
	st.d	$a3, $a1, 8	# save argument pointer
	or	$a0, $a2, $zero
	or	$a2, $a4, $zero
	or	$a3, $a6, $zero
	or	$a4, $a5, $zero
	ori	$a7, $zero, 220
	syscall 0		# call clone

	beqz	$a0, 1f		# whether child process
	jirl	$zero, $ra, 0	# parent process return
1:
	ld.d	$t8, $sp, 0     # function pointer
	ld.d	$a0, $sp, 8     # argument pointer
	jirl	$ra, $t8, 0     # call the user's function
	ori	$a7, $zero, 93
	syscall	0		# child process exit
debug log:

solving a1ac988c ...
found a1ac988c in https://inbox.vuxu.org/musl/b8869794-0624-6a5f-df15-1840609306a1@loongson.cn/

applying [1/1] https://inbox.vuxu.org/musl/b8869794-0624-6a5f-df15-1840609306a1@loongson.cn/
diff --git a/src/thread/loongarch64/clone.s b/src/thread/loongarch64/clone.s
new file mode 100644
index 00000000..a1ac988c

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

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