v0.10.0-alpha.4 49bede1

sys_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
10// Stack usage:
11//  0(SP)  - 56(SP):  stack args a9-a15 (7 * 8 bytes = 56)
12// 56(SP)  - 64(SP):  saved RA (x1)
13// 64(SP)  - 72(SP):  saved X9 (s1)
14// 72(SP)  - 80(SP):  saved X18 (s2)
15// 80(SP)  - 88(SP):  saved args pointer (original X10)
16// 88(SP)  - 96(SP):  padding
17#define STACK_SIZE 96
18#define SAVE_RA    56
19#define SAVE_X9    64
20#define SAVE_X18   72
21#define SAVE_ARGP  80
22
23GLOBL ·syscall15XABI0(SB), NOPTR|RODATA, $8
24DATA ·syscall15XABI0(SB)/8, $syscall15X(SB)
25
26TEXT syscall15X(SB), NOSPLIT, $0
27	// Allocate stack frame (keeps 16-byte alignment)
28	SUB $STACK_SIZE, SP
29
30	// Save callee-saved regs we clobber + return address
31	MOV X1, SAVE_RA(SP)
32	MOV X9, SAVE_X9(SP)
33	MOV X18, SAVE_X18(SP)
34
35	// Save original args pointer (in a0/X10)
36	MOV X10, SAVE_ARGP(SP)
37
38	// X9 := args pointer (syscall15Args*)
39	MOV X10, X9
40
41	// Load float args into fa0-fa7 (F10-F17)
42	MOVD syscall15Args_f1(X9), F10
43	MOVD syscall15Args_f2(X9), F11
44	MOVD syscall15Args_f3(X9), F12
45	MOVD syscall15Args_f4(X9), F13
46	MOVD syscall15Args_f5(X9), F14
47	MOVD syscall15Args_f6(X9), F15
48	MOVD syscall15Args_f7(X9), F16
49	MOVD syscall15Args_f8(X9), F17
50
51	// Load integer args into a0-a7 (X10-X17)
52	MOV syscall15Args_a1(X9), X10
53	MOV syscall15Args_a2(X9), X11
54	MOV syscall15Args_a3(X9), X12
55	MOV syscall15Args_a4(X9), X13
56	MOV syscall15Args_a5(X9), X14
57	MOV syscall15Args_a6(X9), X15
58	MOV syscall15Args_a7(X9), X16
59	MOV syscall15Args_a8(X9), X17
60
61	// Spill a9-a15 onto the stack (C ABI)
62	MOV syscall15Args_a9(X9), X18
63	MOV X18, 0(SP)
64	MOV syscall15Args_a10(X9), X18
65	MOV X18, 8(SP)
66	MOV syscall15Args_a11(X9), X18
67	MOV X18, 16(SP)
68	MOV syscall15Args_a12(X9), X18
69	MOV X18, 24(SP)
70	MOV syscall15Args_a13(X9), X18
71	MOV X18, 32(SP)
72	MOV syscall15Args_a14(X9), X18
73	MOV X18, 40(SP)
74	MOV syscall15Args_a15(X9), X18
75	MOV X18, 48(SP)
76
77	// Call fn
78	// IMPORTANT: preserve RA across this call (we saved it above)
79	MOV  syscall15Args_fn(X9), X18
80	CALL X18
81
82	// Restore args pointer (syscall15Args*) for storing results
83	MOV SAVE_ARGP(SP), X9
84
85	// Store results back
86	MOV X10, syscall15Args_a1(X9)
87	MOV X11, syscall15Args_a2(X9)
88
89	// Store back float return regs if used by your ABI contract
90	MOVD F10, syscall15Args_f1(X9)
91	MOVD F11, syscall15Args_f2(X9)
92	MOVD F12, syscall15Args_f3(X9)
93	MOVD F13, syscall15Args_f4(X9)
94
95	// Restore callee-saved regs and return address
96	MOV SAVE_X18(SP), X18
97	MOV SAVE_X9(SP), X9
98	MOV SAVE_RA(SP), X1
99
100	ADD $STACK_SIZE, SP
101	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