mailing list of musl libc
 help / color / mirror / code / Atom feed
5fc97fc94a28940a9daa74542cec0f9b9f8a15ad blob 761 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
35
36
37
38
39
40
41
42
 
.text
.global __clone
.type   __clone, @function
__clone:
! incoming: fn stack flags arg ptid tls      ctid
!           r4 r5    r6    r7  @r15 @(4,r15) @(8,r15)

	mov   #-16, r0
	and   r0, r5

	mov   r4, r1         ! r1 = fn
	mov.l r7, @-r5       ! (r5) = arg

	mov   #120,     r3   ! r3 = __NR_clone
	mov   r6,       r4   ! r4 = flags
	!mov  r5,       r5   ! r5 = stack
	mov.l @r15,     r6   ! r6 = ptid
	mov.l @(8,r15), r7   ! r7 = ctid
	mov.l @(4,r15), r0   ! r0 = tls

3:	mov.l 1f, r2
	.align 2
2:	braf r2
	 nop
	.hidden __sh_syscall
1:	.long __sh_syscall@PCREL

	cmp/eq #0, r0
	bt     1f

	! we are the parent, return
	rts
	 nop

1:	! we are the child, call fn(arg)
	jsr    @r1
	 mov.l @r15+, r4

	mov   #1, r3   ! __NR_exit
	mov   r0, r4
	bra   3b
	 nop
debug log:

solving 5fc97fc ...
found 5fc97fc in https://inbox.vuxu.org/musl/20150610033050.GS17573@brightrain.aerifal.cx/
found d6c9184 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 d6c9184d40ec01f373bdfc91ebd8e737f095fa62	src/thread/sh/clone.s

applying [1/1] https://inbox.vuxu.org/musl/20150610033050.GS17573@brightrain.aerifal.cx/
diff --git a/src/thread/sh/clone.s b/src/thread/sh/clone.s
index d6c9184..5fc97fc 100644

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

index at:
100644 5fc97fc94a28940a9daa74542cec0f9b9f8a15ad	src/thread/sh/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).