v0.1.0 786906f

trampolines_amd64.s RawHistoryFolder

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3
4//go:build darwin
5// +build darwin
6
7/*
8trampoline for emulating required C functions for cgo in go (see cgo.go)
9(we convert cdecl calling convention to go and vice-versa)
10
11Since we're called from go and call into C we can cheat a bit with the calling conventions:
12 - in go all the registers are caller saved
13 - in C we have a couple of callee saved registers
14
15=> we can use BX, R12, R13, R14, R15 instead of the stack
16
17C Calling convention cdecl used here (we only need integer args):
181. arg: DI
192. arg: SI
203. arg: DX
214. arg: CX
225. arg: R8
236. arg: R9
24We don't need floats with these functions -> AX=0
25return value will be in AX
26*/
27#include "textflag.h"
28#include "go_asm.h"
29
30// these trampolines map the gcc ABI to Go ABI and then calls into the Go equivalent functions.
31
32// TODO: put <> to make these private
33TEXT x_cgo_init_trampoline(SB), NOSPLIT, $16
34	MOVQ DI, 0(SP)
35	MOVQ SI, 8(SP)
36	CALL ·x_cgo_init(SB)
37	RET
38
39TEXT x_cgo_thread_start_trampoline(SB), NOSPLIT, $8
40	MOVQ DI, 0(SP)
41	CALL ·x_cgo_thread_start(SB)
42	RET
43
44TEXT x_cgo_setenv_trampoline(SB), NOSPLIT, $8
45	MOVQ DI, 0(SP)
46	CALL ·x_cgo_setenv(SB)
47	RET
48
49TEXT x_cgo_unsetenv_trampoline(SB), NOSPLIT, $8
50	MOVQ DI, 0(SP)
51	CALL ·x_cgo_unsetenv(SB)
52	RET
53
54TEXT x_cgo_notify_runtime_init_done_trampoline(SB), NOSPLIT, $0
55	CALL ·x_cgo_notify_runtime_init_done(SB)
56	RET
57
58// func setg_trampoline(setg uintptr, g uintptr)
59TEXT ·setg_trampoline(SB), NOSPLIT, $0-16
60	MOVQ G+8(FP), DI
61	MOVQ setg+0(FP), AX
62	CALL AX
63	RET
64
65TEXT threadentry_trampoline(SB), NOSPLIT, $16
66	MOVQ DI, 0(SP)
67	CALL ·threadentry(SB)
68	MOVQ 8(SP), AX
69	RET
70
71TEXT ·setenv(SB), NOSPLIT, $0-0
72	MOVQ name+0(FP), DI
73	MOVQ value+8(FP), SI
74	MOVL overwrite+16(FP), DX
75	CALL libc_setenv(SB)
76	MOVL AX, ret+24(FP)
77	RET
78
79TEXT ·unsetenv(SB), NOSPLIT, $0-0
80	MOVQ name+0(FP), DI
81	CALL libc_unsetenv(SB)
82	MOVL AX, ret+8(FP)
83	RET
84
85TEXT ·malloc(SB), NOSPLIT, $0-0
86	MOVQ size+0(FP), DI
87	CALL libc_malloc(SB)
88	MOVQ AX, ret+8(FP)
89	RET
90
91TEXT ·free(SB), NOSPLIT, $0-0
92	MOVQ ptr+0(FP), DI
93	CALL libc_free(SB)
94	RET
95
96TEXT ·pthread_attr_init(SB), NOSPLIT, $0-12
97	MOVQ attr+0(FP), DI
98	CALL libc_pthread_attr_init(SB)
99	MOVL AX, ret+8(FP)
100	RET
101
102TEXT ·pthread_detach(SB), NOSPLIT, $0-12
103	MOVQ thread+0(FP), DI
104	CALL libc_pthread_detach(SB)
105	MOVL AX, ret+8(FP)
106	RET
107
108TEXT ·pthread_create(SB), NOSPLIT, $0-36
109	MOVQ thread+0(FP), DI
110	MOVQ attr+8(FP), SI
111	MOVQ start+16(FP), DX
112	MOVQ arg+24(FP), CX
113	CALL libc_pthread_create(SB)
114	MOVL AX, ret+32(FP)
115	RET
116
117TEXT ·pthread_attr_destroy(SB), NOSPLIT, $0-0
118	MOVQ attr+0(FP), DI
119	CALL libc_pthread_attr_destroy(SB)
120	MOVL AX, ret+8(FP)
121	RET
122
123TEXT ·pthread_attr_getstacksize(SB), NOSPLIT, $0-0
124	MOVQ attr+0(FP), DI
125	MOVQ stacksize+8(FP), SI
126	CALL libc_pthread_attr_getstacksize(SB)
127	MOVL AX, ret+16(FP)
128	RET
129
130TEXT ·pthread_sigmask(SB), NOSPLIT, $0-0
131	MOVL how+0(FP), DI
132	MOVQ ign+8(FP), SI
133	MOVQ oset+16(FP), DX
134	CALL libc_pthread_sigmask(SB)
135	MOVL AX, ret+24(FP)
136	RET
137
138TEXT ·abort(SB), NOSPLIT, $0-0
139	CALL libc_abort(SB)
140	RET
141
142TEXT ·sigfillset(SB), NOSPLIT, $0-12
143	MOVQ set+0(FP), DI
144	CALL libc_sigfillset(SB)
145	MOVL AX, ret+8(FP)
146	RET
147
148TEXT ·nanosleep(SB), NOSPLIT, $0-20
149	MOVQ ts+0(FP), DI
150	MOVQ rem+8(FP), SI
151	CALL libc_nanosleep(SB)
152	MOVL AX, ret+16(FP)
153	RET

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close