v0.11.0-alpha.11 63002e0

sys_unix_riscv64.s RawHistoryFolder

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2026 The Ebitengine Authors
3
4//go:build linux
5
6#include "textflag.h"
7#include "go_asm.h"
8#include "funcdata.h"
9
10TEXT callbackasm1(SB), NOFRAME, $0
11	NO_LOCAL_POINTERS
12
13	// On entry, the trampoline in zcallback_riscv64.s left
14	// the callback index in X7.
15
16	// Save callback register arguments X10-X17 and F10-F17.
17	// Stack args (if any) are at 0(SP), 8(SP), etc.
18	// We save register args at SP-128, making them contiguous with stack args.
19	ADD $-(16*8), SP, X6
20
21	// Save float arg regs fa0-fa7 (F10-F17)
22	MOVD F10, 0(X6)
23	MOVD F11, 8(X6)
24	MOVD F12, 16(X6)
25	MOVD F13, 24(X6)
26	MOVD F14, 32(X6)
27	MOVD F15, 40(X6)
28	MOVD F16, 48(X6)
29	MOVD F17, 56(X6)
30
31	// Save integer arg regs a0-a7 (X10-X17)
32	MOV X10, 64(X6)
33	MOV X11, 72(X6)
34	MOV X12, 80(X6)
35	MOV X13, 88(X6)
36	MOV X14, 96(X6)
37	MOV X15, 104(X6)
38	MOV X16, 112(X6)
39	MOV X17, 120(X6)
40
41	// Allocate space on stack for RA, saved regs, and callbackArgs.
42	// We need: 8 (RA) + 8 (X9 callee-saved) + 24 (callbackArgs) = 40, round to 176 (22*8)
43	// to match loong64 and ensure we don't overlap with saved register args.
44	// The saved regs end at SP-8 (original), so we need new SP below SP-128.
45	ADD $-(22*8), SP
46
47	// Save link register (RA/X1) and callee-saved register X9
48	// (X9 is used by the assembler for some instructions)
49	MOV X1, 0(SP)
50	MOV X9, 8(SP)
51
52	// Create a struct callbackArgs on our stack.
53	// callbackArgs struct: index(0), args(8), result(16)
54	// Place it at 16(SP) to avoid overlap
55	ADD $16, SP, X9
56	MOV X7, 0(X9)   // callback index
57	MOV X6, 8(X9)   // address of args vector
58	MOV X0, 16(X9)  // result = 0
59
60	// Call crosscall2 with arguments in registers
61	MOV ·callbackWrap_call(SB), X10 // Get the ABIInternal function pointer
62	MOV (X10), X10                  // without <ABIInternal> by using a closure.  X10 = fn
63	MOV X9, X11                     // X11 = frame (address of callbackArgs)
64	MOV X0, X13                     // X13 = ctxt = 0
65
66	CALL crosscall2(SB)
67
68	// Get callback result.
69	ADD $16, SP, X9
70	MOV 16(X9), X10
71
72	// Restore link register and callee-saved X9
73	MOV 8(SP), X9
74	MOV 0(SP), X1
75
76	// Restore stack pointer
77	ADD $(22*8), SP
78
79	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