v0.4.0 2fcc65d

trampolines_amd64.s RawHistoryFolder

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3
4//go:build darwin || linux
5
6/*
7trampoline for emulating required C functions for cgo in go (see cgo.go)
8(we convert cdecl calling convention to go and vice-versa)
9
10Since we're called from go and call into C we can cheat a bit with the calling conventions:
11 - in go all the registers are caller saved
12 - in C we have a couple of callee saved registers
13
14=> we can use BX, R12, R13, R14, R15 instead of the stack
15
16C Calling convention cdecl used here (we only need integer args):
171. arg: DI
182. arg: SI
193. arg: DX
204. arg: CX
215. arg: R8
226. arg: R9
23We don't need floats with these functions -> AX=0
24return value will be in AX
25*/
26#include "textflag.h"
27#include "go_asm.h"
28
29// these trampolines map the gcc ABI to Go ABI and then calls into the Go equivalent functions.
30
31TEXT x_cgo_init_trampoline(SB), NOSPLIT, $16
32	MOVQ DI, AX
33	MOVQ SI, BX
34	MOVQ ·x_cgo_init_call(SB), DX
35	MOVQ (DX), CX
36	CALL CX
37	RET
38
39TEXT x_cgo_thread_start_trampoline(SB), NOSPLIT, $8
40	MOVQ DI, AX
41	MOVQ ·x_cgo_thread_start_call(SB), DX
42	MOVQ (DX), CX
43	CALL CX
44	RET
45
46TEXT x_cgo_setenv_trampoline(SB), NOSPLIT, $8
47	MOVQ DI, AX
48	MOVQ ·x_cgo_setenv_call(SB), DX
49	MOVQ (DX), CX
50	CALL CX
51	RET
52
53TEXT x_cgo_unsetenv_trampoline(SB), NOSPLIT, $8
54	MOVQ DI, AX
55	MOVQ ·x_cgo_unsetenv_call(SB), DX
56	MOVQ (DX), CX
57	CALL CX
58	RET
59
60TEXT x_cgo_notify_runtime_init_done_trampoline(SB), NOSPLIT, $0
61	CALL ·x_cgo_notify_runtime_init_done(SB)
62	RET
63
64TEXT x_cgo_bindm_trampoline(SB), NOSPLIT, $0
65	CALL ·x_cgo_bindm(SB)
66	RET
67
68// func setg_trampoline(setg uintptr, g uintptr)
69TEXT ·setg_trampoline(SB), NOSPLIT, $0-16
70	MOVQ G+8(FP), DI
71	MOVQ setg+0(FP), BX
72	XORL AX, AX
73	CALL BX
74	RET
75
76TEXT threadentry_trampoline(SB), NOSPLIT, $16
77	MOVQ DI, AX
78	MOVQ ·threadentry_call(SB), DX
79	MOVQ (DX), CX
80	CALL CX
81	RET
82
83TEXT ·call5(SB), NOSPLIT, $0-56
84	MOVQ fn+0(FP), BX
85	MOVQ a1+8(FP), DI
86	MOVQ a2+16(FP), SI
87	MOVQ a3+24(FP), DX
88	MOVQ a4+32(FP), CX
89	MOVQ a5+40(FP), R8
90
91	XORL AX, AX // no floats
92
93	PUSHQ BP       // save BP
94	MOVQ  SP, BP   // save SP inside BP bc BP is callee-saved
95	SUBQ  $16, SP  // allocate space for alignment
96	ANDQ  $-16, SP // align on 16 bytes for SSE
97
98	CALL BX
99
100	MOVQ BP, SP // get SP back
101	POPQ BP     // restore BP
102
103	MOVQ AX, ret+48(FP)
104	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