v0.2.0-alpha.1 dd32623

sys_darwin_amd64.s RawHistoryFolder

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3
4#include "textflag.h"
5#include "internal/abi/abi_amd64.h"
6#include "go_asm.h"
7#include "funcdata.h"
8
9// syscall9X calls a function in libc on behalf of the syscall package.
10// syscall9X takes a pointer to a struct like:
11// struct {
12//	fn    uintptr
13//	a1    uintptr
14//	a2    uintptr
15//	a3    uintptr
16//	a4    uintptr
17//	a5    uintptr
18//	a6    uintptr
19//	a7    uintptr
20//	a8    uintptr
21//	a9    uintptr
22//	r1    uintptr
23//	r2    uintptr
24//	err   uintptr
25// }
26// syscall9X must be called on the g0 stack with the
27// C calling convention (use libcCall).
28GLOBL ·syscall9XABI0(SB), NOPTR|RODATA, $8
29DATA ·syscall9XABI0(SB)/8, $syscall9X(SB)
30TEXT syscall9X(SB), NOSPLIT, $0
31	PUSHQ BP
32	MOVQ  SP, BP
33	SUBQ  $32, SP
34	MOVQ  DI, 24(BP) // save the pointer
35
36	MOVQ syscall9Args_f1(DI), X0 // f1
37	MOVQ syscall9Args_f2(DI), X1 // f2
38	MOVQ syscall9Args_f3(DI), X2 // f3
39	MOVQ syscall9Args_f4(DI), X3 // f4
40	MOVQ syscall9Args_f5(DI), X4 // f5
41	MOVQ syscall9Args_f6(DI), X5 // f6
42	MOVQ syscall9Args_f7(DI), X6 // f7
43	MOVQ syscall9Args_f8(DI), X7 // f8
44
45	MOVQ syscall9Args_fn(DI), R10 // fn
46	MOVQ syscall9Args_a2(DI), SI  // a2
47	MOVQ syscall9Args_a3(DI), DX  // a3
48	MOVQ syscall9Args_a4(DI), CX  // a4
49	MOVQ syscall9Args_a5(DI), R8  // a5
50	MOVQ syscall9Args_a6(DI), R9  // a6
51	MOVQ syscall9Args_a7(DI), R11 // a7
52	MOVQ syscall9Args_a8(DI), R12 // a8
53	MOVQ syscall9Args_a9(DI), R13 // a9
54	MOVQ syscall9Args_a1(DI), DI  // a1
55
56	// push the remaining paramters onto the stack
57	MOVQ R11, 0(SP)  // push a7
58	MOVQ R12, 8(SP)  // push a8
59	MOVQ R13, 16(SP) // push a9
60	XORL AX, AX      // vararg: say "no float args"
61
62	CALL R10
63
64	MOVQ 24(BP), DI              // get the pointer back
65	MOVQ AX, syscall9Args_r1(DI) // r1
66	MOVQ X0, syscall9Args_r2(DI) // r2
67
68	XORL AX, AX  // no error (it's ignored anyway)
69	ADDQ $32, SP
70	MOVQ BP, SP
71	POPQ BP
72	RET
73
74TEXT callbackasm1(SB), NOSPLIT, $0
75	// remove return address from stack, we are not returning to callbackasm, but to its caller.
76	MOVQ 0(SP), AX
77	ADDQ $8, SP
78
79	MOVQ 0(SP), R10 // get the return SP so that we can align register args with stack args
80
81	// make space for first six arguments below the frame
82	ADJSP $6*8, SP
83	MOVQ  DI, 8(SP)
84	MOVQ  SI, 16(SP)
85	MOVQ  DX, 24(SP)
86	MOVQ  CX, 32(SP)
87	MOVQ  R8, 40(SP)
88	MOVQ  R9, 48(SP)
89	LEAQ  8(SP), R8  // R8 = address of args vector
90
91	MOVQ R10, 0(SP) // push the stack pointer below registers
92
93	// determine index into runtime·cbs table
94	MOVQ $callbackasm(SB), DX
95	SUBQ DX, AX
96	MOVQ $0, DX
97	MOVQ $5, CX               // divide by 5 because each call instruction in ·callbacks is 5 bytes long
98	DIVL CX
99	SUBQ $1, AX               // subtract 1 because return PC is to the next slot
100
101	// Switch from the host ABI to the Go ABI.
102	PUSH_REGS_HOST_TO_ABI0()
103
104	// Create a struct callbackArgs on our stack to be passed as
105	// the "frame" to cgocallback and on to callbackWrap.
106	// $24 to make enough room for the arguments to runtime.cgocallback
107	SUBQ $(24+callbackArgs__size), SP
108	MOVQ AX, (24+callbackArgs_index)(SP)  // callback index
109	MOVQ R8, (24+callbackArgs_args)(SP)   // address of args vector
110	MOVQ $0, (24+callbackArgs_result)(SP) // result
111	LEAQ 24(SP), AX                       // take the address of callbackArgs
112
113	// Call cgocallback, which will call callbackWrap(frame).
114	MOVQ ·callbackWrap_call(SB), DI // Get the ABIInternal function pointer
115	MOVQ (DI), DI                   // without <ABIInternal> by using a closure.
116	MOVQ AX, SI                     // frame (address of callbackArgs)
117	MOVQ $0, CX                     // context
118
119	CALL crosscall2(SB) // runtime.cgocallback(fn, frame, ctxt uintptr)
120
121	// Get callback result.
122	MOVQ (24+callbackArgs_result)(SP), AX
123	ADDQ $(24+callbackArgs__size), SP     // remove callbackArgs struct
124
125	POP_REGS_HOST_TO_ABI0()
126
127	MOVQ 0(SP), R10 // get the SP back
128
129	ADJSP $-6*8, SP // remove arguments
130
131	MOVQ R10, 0(SP)
132
133	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