v0.8.0 ed3ae3d

syscall_cgo_unix.go RawHistoryFolder

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3
4//go:build freebsd || (linux && !(arm64 || amd64))
5
6package cgo
7
8// this file is placed inside internal/cgo and not package purego
9// because Cgo and assembly files can't be in the same package.
10
11/*
12 #cgo LDFLAGS: -ldl
13
14#include <stdint.h>
15#include <dlfcn.h>
16#include <errno.h>
17#include <assert.h>
18
19typedef struct syscall15Args {
20	uintptr_t fn;
21	uintptr_t a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15;
22	uintptr_t f1, f2, f3, f4, f5, f6, f7, f8;
23	uintptr_t err;
24} syscall15Args;
25
26void syscall15(struct syscall15Args *args) {
27	assert((args->f1|args->f2|args->f3|args->f4|args->f5|args->f6|args->f7|args->f8) == 0);
28	uintptr_t (*func_name)(uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6,
29		uintptr_t a7, uintptr_t a8, uintptr_t a9, uintptr_t a10, uintptr_t a11, uintptr_t a12,
30		uintptr_t a13, uintptr_t a14, uintptr_t a15);
31	*(void**)(&func_name) = (void*)(args->fn);
32	uintptr_t r1 =  func_name(args->a1,args->a2,args->a3,args->a4,args->a5,args->a6,args->a7,args->a8,args->a9,
33		args->a10,args->a11,args->a12,args->a13,args->a14,args->a15);
34	args->a1 = r1;
35	args->err = errno;
36}
37
38*/
39import "C"
40import "unsafe"
41
42// assign purego.syscall15XABI0 to the C version of this function.
43var Syscall15XABI0 = unsafe.Pointer(C.syscall15)
44
45//go:nosplit
46func Syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
47	args := C.syscall15Args{
48		C.uintptr_t(fn), C.uintptr_t(a1), C.uintptr_t(a2), C.uintptr_t(a3),
49		C.uintptr_t(a4), C.uintptr_t(a5), C.uintptr_t(a6),
50		C.uintptr_t(a7), C.uintptr_t(a8), C.uintptr_t(a9), C.uintptr_t(a10), C.uintptr_t(a11), C.uintptr_t(a12),
51		C.uintptr_t(a13), C.uintptr_t(a14), C.uintptr_t(a15), 0, 0, 0, 0, 0, 0, 0, 0, 0,
52	}
53	C.syscall15(&args)
54	return uintptr(args.a1), 0, uintptr(args.err)
55}

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