detached 0e63021

Consolidate struct definition (#229)

The struct on Cgo non-amd64 and non-arm64 platforms didn't have the struct fields updated. To avoid forgetting to update all the structs I've moved it where every platform shares the same type def.

Closes #228
commit
0e6302132b78c60006ba19462e97177340773055
author
TotallyGamerJet · · 2024-04-07 11:16 UTC
committer
GitHub · · 2024-04-07 11:16 UTC
parent
5438b70
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
4 files · +6 -20
M syscall.go +6 -0
@@ -10,6 +10,12 @@ const (
1010 numOfFloats = 8 // arm64 and amd64 both have 8 float registers
1111 )
1212
13+type syscall15Args struct {
14+ fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
15+ f1, f2, f3, f4, f5, f6, f7, f8 uintptr
16+ arm64_r8 uintptr
17+}
18+
1319 // SyscallN takes fn, a C function pointer and a list of arguments as uintptr.
1420 // There is an internal maximum number of arguments that SyscallN can take. It panics
1521 // when the maximum is exceeded. It returns the result and the libc error code if there is one.
@@ -10,6 +10,12 @@ const (
10 numOfFloats = 8 // arm64 and amd64 both have 8 float registers10 numOfFloats = 8 // arm64 and amd64 both have 8 float registers
11 )11 )
12 12
13+type syscall15Args struct {
14+ fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
15+ f1, f2, f3, f4, f5, f6, f7, f8 uintptr
16+ arm64_r8 uintptr
17+}
18+
13 // SyscallN takes fn, a C function pointer and a list of arguments as uintptr.19 // SyscallN takes fn, a C function pointer and a list of arguments as uintptr.
14 // There is an internal maximum number of arguments that SyscallN can take. It panics20 // There is an internal maximum number of arguments that SyscallN can take. It panics
15 // when the maximum is exceeded. It returns the result and the libc error code if there is one.21 // when the maximum is exceeded. It returns the result and the libc error code if there is one.
M syscall_cgo_linux.go +0 -8
@@ -13,14 +13,6 @@ import (
1313
1414 var syscall15XABI0 = uintptr(cgo.Syscall15XABI0)
1515
16-// this is only here to make the assembly files happy :)
17-type syscall15Args struct {
18- fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
19- f1, f2, f3, f4, f5, f6, f7, f8 uintptr
20- r1, r2, err uintptr
21- arm64_r8 uintptr
22-}
23-
2416 //go:nosplit
2517 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
2618 return cgo.Syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)
@@ -13,14 +13,6 @@ import (
13 13
14 var syscall15XABI0 = uintptr(cgo.Syscall15XABI0)14 var syscall15XABI0 = uintptr(cgo.Syscall15XABI0)
15 15
16-// this is only here to make the assembly files happy :)
17-type syscall15Args struct {
18- fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
19- f1, f2, f3, f4, f5, f6, f7, f8 uintptr
20- r1, r2, err uintptr
21- arm64_r8 uintptr
22-}
23-
24 //go:nosplit16 //go:nosplit
25 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {17 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
26 return cgo.Syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)18 return cgo.Syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)
M syscall_sysv.go +0 -6
@@ -14,12 +14,6 @@ import (
1414
1515 var syscall15XABI0 uintptr
1616
17-type syscall15Args struct {
18- fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
19- f1, f2, f3, f4, f5, f6, f7, f8 uintptr
20- arm64_r8 uintptr
21-}
22-
2317 //go:nosplit
2418 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
2519 args := syscall15Args{
@@ -14,12 +14,6 @@ import (
14 14
15 var syscall15XABI0 uintptr15 var syscall15XABI0 uintptr
16 16
17-type syscall15Args struct {
18- fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
19- f1, f2, f3, f4, f5, f6, f7, f8 uintptr
20- arm64_r8 uintptr
21-}
22-
23 //go:nosplit17 //go:nosplit
24 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {18 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
25 args := syscall15Args{19 args := syscall15Args{
M syscall_windows.go +0 -6
@@ -12,12 +12,6 @@ import (
1212
1313 var syscall15XABI0 uintptr
1414
15-type syscall15Args struct {
16- fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
17- f1, f2, f3, f4, f5, f6, f7, f8 uintptr
18- arm64_r8 uintptr
19-}
20-
2115 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
2216 r1, r2, errno := syscall.Syscall15(fn, 15, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)
2317 return r1, r2, uintptr(errno)
@@ -12,12 +12,6 @@ import (
12 12
13 var syscall15XABI0 uintptr13 var syscall15XABI0 uintptr
14 14
15-type syscall15Args struct {
16- fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr
17- f1, f2, f3, f4, f5, f6, f7, f8 uintptr
18- arm64_r8 uintptr
19-}
20-
21 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {15 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
22 r1, r2, errno := syscall.Syscall15(fn, 15, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)16 r1, r2, errno := syscall.Syscall15(fn, 15, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)
23 return r1, r2, uintptr(errno)17 return r1, r2, uintptr(errno)

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