detached 26d1789

all: fix for 1.21 (#145)

commit
26d1789b9e6a34cefab6065ad5fec073ab83666b
author
TotallyGamerJet · · 2023-07-20 11:01 UTC
committer
GitHub · · 2023-07-20 11:01 UTC
parent
b178e75
signature
GPG Unverified4AEE18F83AFDEB23 The key is unknown
18 files · +192 -38
M .github/workflows/test.yml +1 -1
@@ -7,7 +7,7 @@ jobs:
77 strategy:
88 matrix:
99 os: [ubuntu-latest, macos-latest, windows-latest]
10- go: ['1.18.x', '1.19.x', '1.20.x']
10+ go: ['1.18.x', '1.19.x', '1.20.x', '1.21.0-rc.3']
1111 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
1212 runs-on: ${{ matrix.os }}
1313 defaults:
@@ -7,7 +7,7 @@ jobs:
7 strategy:7 strategy:
8 matrix:8 matrix:
9 os: [ubuntu-latest, macos-latest, windows-latest]9 os: [ubuntu-latest, macos-latest, windows-latest]
10- go: ['1.18.x', '1.19.x', '1.20.x']10+ go: ['1.18.x', '1.19.x', '1.20.x', '1.21.0-rc.3']
11 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}11 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
12 runs-on: ${{ matrix.os }}12 runs-on: ${{ matrix.os }}
13 defaults:13 defaults:
M dlfcn_stubs.s +4 -4
@@ -6,21 +6,21 @@
66 #include "textflag.h"
77
88 // func dlopen(path *byte, mode int) (ret uintptr)
9-TEXT dlopen(SB), NOSPLIT, $0-0
9+TEXT dlopen(SB), NOSPLIT|NOFRAME, $0-0
1010 JMP purego_dlopen(SB)
1111 RET
1212
1313 // func dlsym(handle uintptr, symbol *byte) (ret uintptr)
14-TEXT dlsym(SB), NOSPLIT, $0-0
14+TEXT dlsym(SB), NOSPLIT|NOFRAME, $0-0
1515 JMP purego_dlsym(SB)
1616 RET
1717
1818 // func dlerror() (ret *byte)
19-TEXT dlerror(SB), NOSPLIT, $0-0
19+TEXT dlerror(SB), NOSPLIT|NOFRAME, $0-0
2020 JMP purego_dlerror(SB)
2121 RET
2222
2323 // func dlclose(handle uintptr) (ret int)
24-TEXT dlclose(SB), NOSPLIT, $0-0
24+TEXT dlclose(SB), NOSPLIT|NOFRAME, $0-0
2525 JMP purego_dlclose(SB)
2626 RET
@@ -6,21 +6,21 @@
6 #include "textflag.h"6 #include "textflag.h"
7 7
8 // func dlopen(path *byte, mode int) (ret uintptr)8 // func dlopen(path *byte, mode int) (ret uintptr)
9-TEXT dlopen(SB), NOSPLIT, $0-09+TEXT dlopen(SB), NOSPLIT|NOFRAME, $0-0
10 JMP purego_dlopen(SB)10 JMP purego_dlopen(SB)
11 RET11 RET
12 12
13 // func dlsym(handle uintptr, symbol *byte) (ret uintptr)13 // func dlsym(handle uintptr, symbol *byte) (ret uintptr)
14-TEXT dlsym(SB), NOSPLIT, $0-014+TEXT dlsym(SB), NOSPLIT|NOFRAME, $0-0
15 JMP purego_dlsym(SB)15 JMP purego_dlsym(SB)
16 RET16 RET
17 17
18 // func dlerror() (ret *byte)18 // func dlerror() (ret *byte)
19-TEXT dlerror(SB), NOSPLIT, $0-019+TEXT dlerror(SB), NOSPLIT|NOFRAME, $0-0
20 JMP purego_dlerror(SB)20 JMP purego_dlerror(SB)
21 RET21 RET
22 22
23 // func dlclose(handle uintptr) (ret int)23 // func dlclose(handle uintptr) (ret int)
24-TEXT dlclose(SB), NOSPLIT, $0-024+TEXT dlclose(SB), NOSPLIT|NOFRAME, $0-0
25 JMP purego_dlclose(SB)25 JMP purego_dlclose(SB)
26 RET26 RET
M internal/fakecgo/callbacks.go +30 -1
@@ -6,7 +6,9 @@
66
77 package fakecgo
88
9-import _ "unsafe"
9+import (
10+ _ "unsafe"
11+)
1012
1113 // TODO: decide if we need _runtime_cgo_panic_internal
1214
@@ -39,6 +41,33 @@ var _cgo_thread_start = &x_cgo_thread_start_trampoline
3941 var x_cgo_notify_runtime_init_done_trampoline byte
4042 var _cgo_notify_runtime_init_done = &x_cgo_notify_runtime_init_done_trampoline
4143
44+// Indicates whether a dummy thread key has been created or not.
45+//
46+// When calling go exported function from C, we register a destructor
47+// callback, for a dummy thread key, by using pthread_key_create.
48+
49+//go:linkname _cgo_pthread_key_created _cgo_pthread_key_created
50+var x_cgo_pthread_key_created uintptr
51+var _cgo_pthread_key_created = &x_cgo_pthread_key_created
52+
53+// Set the x_crosscall2_ptr C function pointer variable point to crosscall2.
54+// It's for the runtime package to call at init time.
55+func set_crosscall2() {
56+ // nothing needs to be done here for fakecgo
57+ // because it's possible to just call cgocallback directly
58+}
59+
60+//go:linkname _set_crosscall2 runtime.set_crosscall2
61+var _set_crosscall2 = set_crosscall2
62+
63+// Store the g into the thread-specific value.
64+// So that pthread_key_destructor will dropm when the thread is exiting.
65+
66+//go:linkname x_cgo_bindm_trampoline x_cgo_bindm_trampoline
67+//go:linkname _cgo_bindm _cgo_bindm
68+var x_cgo_bindm_trampoline byte
69+var _cgo_bindm = &x_cgo_bindm_trampoline
70+
4271 // TODO: decide if we need x_cgo_set_context_function
4372 // TODO: decide if we need _cgo_yield
4473
@@ -6,7 +6,9 @@
6 6
7 package fakecgo7 package fakecgo
8 8
9-import _ "unsafe"9+import (
10+ _ "unsafe"
11+)
10 12
11 // TODO: decide if we need _runtime_cgo_panic_internal13 // TODO: decide if we need _runtime_cgo_panic_internal
12 14
@@ -39,6 +41,33 @@ var _cgo_thread_start = &x_cgo_thread_start_trampoline
39 var x_cgo_notify_runtime_init_done_trampoline byte41 var x_cgo_notify_runtime_init_done_trampoline byte
40 var _cgo_notify_runtime_init_done = &x_cgo_notify_runtime_init_done_trampoline42 var _cgo_notify_runtime_init_done = &x_cgo_notify_runtime_init_done_trampoline
41 43
44+// Indicates whether a dummy thread key has been created or not.
45+//
46+// When calling go exported function from C, we register a destructor
47+// callback, for a dummy thread key, by using pthread_key_create.
48+
49+//go:linkname _cgo_pthread_key_created _cgo_pthread_key_created
50+var x_cgo_pthread_key_created uintptr
51+var _cgo_pthread_key_created = &x_cgo_pthread_key_created
52+
53+// Set the x_crosscall2_ptr C function pointer variable point to crosscall2.
54+// It's for the runtime package to call at init time.
55+func set_crosscall2() {
56+ // nothing needs to be done here for fakecgo
57+ // because it's possible to just call cgocallback directly
58+}
59+
60+//go:linkname _set_crosscall2 runtime.set_crosscall2
61+var _set_crosscall2 = set_crosscall2
62+
63+// Store the g into the thread-specific value.
64+// So that pthread_key_destructor will dropm when the thread is exiting.
65+
66+//go:linkname x_cgo_bindm_trampoline x_cgo_bindm_trampoline
67+//go:linkname _cgo_bindm _cgo_bindm
68+var x_cgo_bindm_trampoline byte
69+var _cgo_bindm = &x_cgo_bindm_trampoline
70+
42 // TODO: decide if we need x_cgo_set_context_function71 // TODO: decide if we need x_cgo_set_context_function
43 // TODO: decide if we need _cgo_yield72 // TODO: decide if we need _cgo_yield
44 73
M internal/fakecgo/gen.go +5 -1
@@ -94,7 +94,7 @@ const templateTrampolinesStubs = `// Code generated by 'go generate' with gen.go
9494
9595 // these stubs are here because it is not possible to go:linkname directly the C functions on darwin arm64
9696 {{ range . }}
97-TEXT _{{.Name}}(SB), NOSPLIT, $0-0
97+TEXT _{{.Name}}(SB), NOSPLIT|NOFRAME, $0-0
9898 JMP purego_{{.Name}}(SB)
9999 RET
100100 {{ end -}}
@@ -131,6 +131,10 @@ var (
131131 {"pthread_attr_getstacksize", [5]Arg{{"attr", "*pthread_attr_t"}, {"stacksize", "*size_t"}}, "int32"},
132132 {"pthread_attr_setstacksize", [5]Arg{{"attr", "*pthread_attr_t"}, {"size", "size_t"}}, "int32"},
133133 {"pthread_attr_destroy", [5]Arg{{"attr", "*pthread_attr_t"}}, "int32"},
134+ {"pthread_mutex_lock", [5]Arg{{"mutex", "*pthread_mutex_t"}}, "int32"},
135+ {"pthread_mutex_unlock", [5]Arg{{"mutex", "*pthread_mutex_t"}}, "int32"},
136+ {"pthread_cond_broadcast", [5]Arg{{"cond", "*pthread_cond_t"}}, "int32"},
137+ {"pthread_setspecific", [5]Arg{{"key", "pthread_key_t"}, {"value", "unsafe.Pointer"}}, "int32"},
134138 }
135139 )
136140
@@ -94,7 +94,7 @@ const templateTrampolinesStubs = `// Code generated by 'go generate' with gen.go
94 94
95 // these stubs are here because it is not possible to go:linkname directly the C functions on darwin arm6495 // these stubs are here because it is not possible to go:linkname directly the C functions on darwin arm64
96 {{ range . }}96 {{ range . }}
97-TEXT _{{.Name}}(SB), NOSPLIT, $0-097+TEXT _{{.Name}}(SB), NOSPLIT|NOFRAME, $0-0
98 JMP purego_{{.Name}}(SB)98 JMP purego_{{.Name}}(SB)
99 RET99 RET
100 {{ end -}}100 {{ end -}}
@@ -131,6 +131,10 @@ var (
131 {"pthread_attr_getstacksize", [5]Arg{{"attr", "*pthread_attr_t"}, {"stacksize", "*size_t"}}, "int32"},131 {"pthread_attr_getstacksize", [5]Arg{{"attr", "*pthread_attr_t"}, {"stacksize", "*size_t"}}, "int32"},
132 {"pthread_attr_setstacksize", [5]Arg{{"attr", "*pthread_attr_t"}, {"size", "size_t"}}, "int32"},132 {"pthread_attr_setstacksize", [5]Arg{{"attr", "*pthread_attr_t"}, {"size", "size_t"}}, "int32"},
133 {"pthread_attr_destroy", [5]Arg{{"attr", "*pthread_attr_t"}}, "int32"},133 {"pthread_attr_destroy", [5]Arg{{"attr", "*pthread_attr_t"}}, "int32"},
134+ {"pthread_mutex_lock", [5]Arg{{"mutex", "*pthread_mutex_t"}}, "int32"},
135+ {"pthread_mutex_unlock", [5]Arg{{"mutex", "*pthread_mutex_t"}}, "int32"},
136+ {"pthread_cond_broadcast", [5]Arg{{"cond", "*pthread_cond_t"}}, "int32"},
137+ {"pthread_setspecific", [5]Arg{{"key", "pthread_key_t"}, {"value", "unsafe.Pointer"}}, "int32"},
134 }138 }
135 )139 )
136 140
M internal/fakecgo/go_libinit.go +23 -2
@@ -10,9 +10,30 @@ import (
1010 "unsafe"
1111 )
1212
13+var (
14+ pthread_g pthread_key_t
15+
16+ runtime_init_cond = PTHREAD_COND_INITIALIZER
17+ runtime_init_mu = PTHREAD_MUTEX_INITIALIZER
18+ runtime_init_done int
19+)
20+
1321 //go:nosplit
1422 func x_cgo_notify_runtime_init_done() {
15- // we don't support being called as a library
23+ pthread_mutex_lock(&runtime_init_mu)
24+ runtime_init_done = 1
25+ pthread_cond_broadcast(&runtime_init_cond)
26+ pthread_mutex_unlock(&runtime_init_mu)
27+}
28+
29+// Store the g into a thread-specific value associated with the pthread key pthread_g.
30+// And pthread_key_destructor will dropm when the thread is exiting.
31+func x_cgo_bindm(g unsafe.Pointer) {
32+ // We assume this will always succeed, otherwise, there might be extra M leaking,
33+ // when a C thread exits after a cgo call.
34+ // We only invoke this function once per thread in runtime.needAndBindM,
35+ // and the next calls just reuse the bound m.
36+ pthread_setspecific(pthread_g, g)
1637 }
1738
1839 // _cgo_try_pthread_create retries pthread_create if it fails with
@@ -25,7 +46,7 @@ func _cgo_try_pthread_create(thread *pthread_t, attr *pthread_attr_t, pfn unsafe
2546 // tries needs to be the same type as syscall.Timespec.Nsec
2647 // but the fields are int32 on 32bit and int64 on 64bit.
2748 // tries is assigned to syscall.Timespec.Nsec in order to match its type.
28- var tries = ts.Nsec
49+ tries := ts.Nsec
2950 var err int
3051
3152 for tries = 0; tries < 20; tries++ {
@@ -10,9 +10,30 @@ import (
10 "unsafe"10 "unsafe"
11 )11 )
12 12
13+var (
14+ pthread_g pthread_key_t
15+
16+ runtime_init_cond = PTHREAD_COND_INITIALIZER
17+ runtime_init_mu = PTHREAD_MUTEX_INITIALIZER
18+ runtime_init_done int
19+)
20+
13 //go:nosplit21 //go:nosplit
14 func x_cgo_notify_runtime_init_done() {22 func x_cgo_notify_runtime_init_done() {
15- // we don't support being called as a library23+ pthread_mutex_lock(&runtime_init_mu)
24+ runtime_init_done = 1
25+ pthread_cond_broadcast(&runtime_init_cond)
26+ pthread_mutex_unlock(&runtime_init_mu)
27+}
28+
29+// Store the g into a thread-specific value associated with the pthread key pthread_g.
30+// And pthread_key_destructor will dropm when the thread is exiting.
31+func x_cgo_bindm(g unsafe.Pointer) {
32+ // We assume this will always succeed, otherwise, there might be extra M leaking,
33+ // when a C thread exits after a cgo call.
34+ // We only invoke this function once per thread in runtime.needAndBindM,
35+ // and the next calls just reuse the bound m.
36+ pthread_setspecific(pthread_g, g)
16 }37 }
17 38
18 // _cgo_try_pthread_create retries pthread_create if it fails with39 // _cgo_try_pthread_create retries pthread_create if it fails with
@@ -25,7 +46,7 @@ func _cgo_try_pthread_create(thread *pthread_t, attr *pthread_attr_t, pfn unsafe
25 // tries needs to be the same type as syscall.Timespec.Nsec46 // tries needs to be the same type as syscall.Timespec.Nsec
26 // but the fields are int32 on 32bit and int64 on 64bit.47 // but the fields are int32 on 32bit and int64 on 64bit.
27 // tries is assigned to syscall.Timespec.Nsec in order to match its type.48 // tries is assigned to syscall.Timespec.Nsec in order to match its type.
28- var tries = ts.Nsec49+ tries := ts.Nsec
29 var err int50 var err int
30 51
31 for tries = 0; tries < 20; tries++ {52 for tries = 0; tries < 20; tries++ {
M internal/fakecgo/libcgo.go +7 -4
@@ -5,10 +5,13 @@
55
66 package fakecgo
77
8-type size_t uintptr
9-type sigset_t [128]byte
10-type pthread_attr_t [64]byte
11-type pthread_t int
8+type (
9+ size_t uintptr
10+ sigset_t [128]byte
11+ pthread_attr_t [64]byte
12+ pthread_t int
13+ pthread_key_t uint64
14+)
1215
1316 // for pthread_sigmask:
1417
@@ -5,10 +5,13 @@
5 5
6 package fakecgo6 package fakecgo
7 7
8-type size_t uintptr8+type (
9-type sigset_t [128]byte9+ size_t uintptr
10-type pthread_attr_t [64]byte10+ sigset_t [128]byte
11-type pthread_t int11+ pthread_attr_t [64]byte
12+ pthread_t int
13+ pthread_key_t uint64
14+)
12 15
13 // for pthread_sigmask:16 // for pthread_sigmask:
14 17
A internal/fakecgo/libcgo_darwin.go +20 -0
@@ -0,0 +1,20 @@
1+// SPDX-License-Identifier: Apache-2.0
2+// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3+
4+package fakecgo
5+
6+type (
7+ pthread_mutex_t struct {
8+ sig int64
9+ opaque [56]byte
10+ }
11+ pthread_cond_t struct {
12+ sig int64
13+ opaque [40]byte
14+ }
15+)
16+
17+var (
18+ PTHREAD_COND_INITIALIZER = pthread_cond_t{sig: 0x3CB0B1BB}
19+ PTHREAD_MUTEX_INITIALIZER = pthread_mutex_t{sig: 0x32AAABA7}
20+)
@@ -0,0 +1,20 @@
1+// SPDX-License-Identifier: Apache-2.0
2+// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3+
4+package fakecgo
5+
6+type (
7+ pthread_mutex_t struct {
8+ sig int64
9+ opaque [56]byte
10+ }
11+ pthread_cond_t struct {
12+ sig int64
13+ opaque [40]byte
14+ }
15+)
16+
17+var (
18+ PTHREAD_COND_INITIALIZER = pthread_cond_t{sig: 0x3CB0B1BB}
19+ PTHREAD_MUTEX_INITIALIZER = pthread_mutex_t{sig: 0x32AAABA7}
20+)
A internal/fakecgo/libcgo_linux.go +14 -0
@@ -0,0 +1,14 @@
1+// SPDX-License-Identifier: Apache-2.0
2+// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3+
4+package fakecgo
5+
6+type (
7+ pthread_cond_t [48]byte
8+ pthread_mutex_t [48]byte
9+)
10+
11+var (
12+ PTHREAD_COND_INITIALIZER = pthread_cond_t{}
13+ PTHREAD_MUTEX_INITIALIZER = pthread_mutex_t{}
14+)
@@ -0,0 +1,14 @@
1+// SPDX-License-Identifier: Apache-2.0
2+// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3+
4+package fakecgo
5+
6+type (
7+ pthread_cond_t [48]byte
8+ pthread_mutex_t [48]byte
9+)
10+
11+var (
12+ PTHREAD_COND_INITIALIZER = pthread_cond_t{}
13+ PTHREAD_MUTEX_INITIALIZER = pthread_mutex_t{}
14+)
M internal/fakecgo/symbols.go +32 -0
@@ -87,6 +87,22 @@ func pthread_attr_destroy(attr *pthread_attr_t) int32 {
8787 return int32(call5(pthread_attr_destroyABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0))
8888 }
8989
90+func pthread_mutex_lock(mutex *pthread_mutex_t) int32 {
91+ return int32(call5(pthread_mutex_lockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0))
92+}
93+
94+func pthread_mutex_unlock(mutex *pthread_mutex_t) int32 {
95+ return int32(call5(pthread_mutex_unlockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0))
96+}
97+
98+func pthread_cond_broadcast(cond *pthread_cond_t) int32 {
99+ return int32(call5(pthread_cond_broadcastABI0, uintptr(unsafe.Pointer(cond)), 0, 0, 0, 0))
100+}
101+
102+func pthread_setspecific(key pthread_key_t, value unsafe.Pointer) int32 {
103+ return int32(call5(pthread_setspecificABI0, uintptr(key), uintptr(value), 0, 0, 0))
104+}
105+
90106 //go:linkname _malloc _malloc
91107 var _malloc uintptr
92108 var mallocABI0 = uintptr(unsafe.Pointer(&_malloc))
@@ -150,3 +166,19 @@ var pthread_attr_setstacksizeABI0 = uintptr(unsafe.Pointer(&_pthread_attr_setsta
150166 //go:linkname _pthread_attr_destroy _pthread_attr_destroy
151167 var _pthread_attr_destroy uintptr
152168 var pthread_attr_destroyABI0 = uintptr(unsafe.Pointer(&_pthread_attr_destroy))
169+
170+//go:linkname _pthread_mutex_lock _pthread_mutex_lock
171+var _pthread_mutex_lock uintptr
172+var pthread_mutex_lockABI0 = uintptr(unsafe.Pointer(&_pthread_mutex_lock))
173+
174+//go:linkname _pthread_mutex_unlock _pthread_mutex_unlock
175+var _pthread_mutex_unlock uintptr
176+var pthread_mutex_unlockABI0 = uintptr(unsafe.Pointer(&_pthread_mutex_unlock))
177+
178+//go:linkname _pthread_cond_broadcast _pthread_cond_broadcast
179+var _pthread_cond_broadcast uintptr
180+var pthread_cond_broadcastABI0 = uintptr(unsafe.Pointer(&_pthread_cond_broadcast))
181+
182+//go:linkname _pthread_setspecific _pthread_setspecific
183+var _pthread_setspecific uintptr
184+var pthread_setspecificABI0 = uintptr(unsafe.Pointer(&_pthread_setspecific))
@@ -87,6 +87,22 @@ func pthread_attr_destroy(attr *pthread_attr_t) int32 {
87 return int32(call5(pthread_attr_destroyABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0))87 return int32(call5(pthread_attr_destroyABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0))
88 }88 }
89 89
90+func pthread_mutex_lock(mutex *pthread_mutex_t) int32 {
91+ return int32(call5(pthread_mutex_lockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0))
92+}
93+
94+func pthread_mutex_unlock(mutex *pthread_mutex_t) int32 {
95+ return int32(call5(pthread_mutex_unlockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0))
96+}
97+
98+func pthread_cond_broadcast(cond *pthread_cond_t) int32 {
99+ return int32(call5(pthread_cond_broadcastABI0, uintptr(unsafe.Pointer(cond)), 0, 0, 0, 0))
100+}
101+
102+func pthread_setspecific(key pthread_key_t, value unsafe.Pointer) int32 {
103+ return int32(call5(pthread_setspecificABI0, uintptr(key), uintptr(value), 0, 0, 0))
104+}
105+
90 //go:linkname _malloc _malloc106 //go:linkname _malloc _malloc
91 var _malloc uintptr107 var _malloc uintptr
92 var mallocABI0 = uintptr(unsafe.Pointer(&_malloc))108 var mallocABI0 = uintptr(unsafe.Pointer(&_malloc))
@@ -150,3 +166,19 @@ var pthread_attr_setstacksizeABI0 = uintptr(unsafe.Pointer(&_pthread_attr_setsta
150 //go:linkname _pthread_attr_destroy _pthread_attr_destroy166 //go:linkname _pthread_attr_destroy _pthread_attr_destroy
151 var _pthread_attr_destroy uintptr167 var _pthread_attr_destroy uintptr
152 var pthread_attr_destroyABI0 = uintptr(unsafe.Pointer(&_pthread_attr_destroy))168 var pthread_attr_destroyABI0 = uintptr(unsafe.Pointer(&_pthread_attr_destroy))
169+
170+//go:linkname _pthread_mutex_lock _pthread_mutex_lock
171+var _pthread_mutex_lock uintptr
172+var pthread_mutex_lockABI0 = uintptr(unsafe.Pointer(&_pthread_mutex_lock))
173+
174+//go:linkname _pthread_mutex_unlock _pthread_mutex_unlock
175+var _pthread_mutex_unlock uintptr
176+var pthread_mutex_unlockABI0 = uintptr(unsafe.Pointer(&_pthread_mutex_unlock))
177+
178+//go:linkname _pthread_cond_broadcast _pthread_cond_broadcast
179+var _pthread_cond_broadcast uintptr
180+var pthread_cond_broadcastABI0 = uintptr(unsafe.Pointer(&_pthread_cond_broadcast))
181+
182+//go:linkname _pthread_setspecific _pthread_setspecific
183+var _pthread_setspecific uintptr
184+var pthread_setspecificABI0 = uintptr(unsafe.Pointer(&_pthread_setspecific))
M internal/fakecgo/symbols_darwin.go +4 -0
@@ -21,3 +21,7 @@ package fakecgo
2121 //go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "/usr/lib/libSystem.B.dylib"
2222 //go:cgo_import_dynamic purego_pthread_attr_setstacksize pthread_attr_setstacksize "/usr/lib/libSystem.B.dylib"
2323 //go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "/usr/lib/libSystem.B.dylib"
24+//go:cgo_import_dynamic purego_pthread_mutex_lock pthread_mutex_lock "/usr/lib/libSystem.B.dylib"
25+//go:cgo_import_dynamic purego_pthread_mutex_unlock pthread_mutex_unlock "/usr/lib/libSystem.B.dylib"
26+//go:cgo_import_dynamic purego_pthread_cond_broadcast pthread_cond_broadcast "/usr/lib/libSystem.B.dylib"
27+//go:cgo_import_dynamic purego_pthread_setspecific pthread_setspecific "/usr/lib/libSystem.B.dylib"
@@ -21,3 +21,7 @@ package fakecgo
21 //go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "/usr/lib/libSystem.B.dylib"21 //go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "/usr/lib/libSystem.B.dylib"
22 //go:cgo_import_dynamic purego_pthread_attr_setstacksize pthread_attr_setstacksize "/usr/lib/libSystem.B.dylib"22 //go:cgo_import_dynamic purego_pthread_attr_setstacksize pthread_attr_setstacksize "/usr/lib/libSystem.B.dylib"
23 //go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "/usr/lib/libSystem.B.dylib"23 //go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "/usr/lib/libSystem.B.dylib"
24+//go:cgo_import_dynamic purego_pthread_mutex_lock pthread_mutex_lock "/usr/lib/libSystem.B.dylib"
25+//go:cgo_import_dynamic purego_pthread_mutex_unlock pthread_mutex_unlock "/usr/lib/libSystem.B.dylib"
26+//go:cgo_import_dynamic purego_pthread_cond_broadcast pthread_cond_broadcast "/usr/lib/libSystem.B.dylib"
27+//go:cgo_import_dynamic purego_pthread_setspecific pthread_setspecific "/usr/lib/libSystem.B.dylib"
M internal/fakecgo/symbols_linux.go +4 -0
@@ -21,3 +21,7 @@ package fakecgo
2121 //go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "libpthread.so.0"
2222 //go:cgo_import_dynamic purego_pthread_attr_setstacksize pthread_attr_setstacksize "libpthread.so.0"
2323 //go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "libpthread.so.0"
24+//go:cgo_import_dynamic purego_pthread_mutex_lock pthread_mutex_lock "libpthread.so.0"
25+//go:cgo_import_dynamic purego_pthread_mutex_unlock pthread_mutex_unlock "libpthread.so.0"
26+//go:cgo_import_dynamic purego_pthread_cond_broadcast pthread_cond_broadcast "libpthread.so.0"
27+//go:cgo_import_dynamic purego_pthread_setspecific pthread_setspecific "libpthread.so.0"
@@ -21,3 +21,7 @@ package fakecgo
21 //go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "libpthread.so.0"21 //go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "libpthread.so.0"
22 //go:cgo_import_dynamic purego_pthread_attr_setstacksize pthread_attr_setstacksize "libpthread.so.0"22 //go:cgo_import_dynamic purego_pthread_attr_setstacksize pthread_attr_setstacksize "libpthread.so.0"
23 //go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "libpthread.so.0"23 //go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "libpthread.so.0"
24+//go:cgo_import_dynamic purego_pthread_mutex_lock pthread_mutex_lock "libpthread.so.0"
25+//go:cgo_import_dynamic purego_pthread_mutex_unlock pthread_mutex_unlock "libpthread.so.0"
26+//go:cgo_import_dynamic purego_pthread_cond_broadcast pthread_cond_broadcast "libpthread.so.0"
27+//go:cgo_import_dynamic purego_pthread_setspecific pthread_setspecific "libpthread.so.0"
M internal/fakecgo/trampolines_amd64.s +4 -0
@@ -61,6 +61,10 @@ TEXT x_cgo_notify_runtime_init_done_trampoline(SB), NOSPLIT, $0
6161 CALL ·x_cgo_notify_runtime_init_done(SB)
6262 RET
6363
64+TEXT x_cgo_bindm_trampoline(SB), NOSPLIT, $0
65+ CALL ·x_cgo_bindm(SB)
66+ RET
67+
6468 // func setg_trampoline(setg uintptr, g uintptr)
6569 TEXT ·setg_trampoline(SB), NOSPLIT, $0-16
6670 MOVQ G+8(FP), DI
@@ -61,6 +61,10 @@ TEXT x_cgo_notify_runtime_init_done_trampoline(SB), NOSPLIT, $0
61 CALL ·x_cgo_notify_runtime_init_done(SB)61 CALL ·x_cgo_notify_runtime_init_done(SB)
62 RET62 RET
63 63
64+TEXT x_cgo_bindm_trampoline(SB), NOSPLIT, $0
65+ CALL ·x_cgo_bindm(SB)
66+ RET
67+
64 // func setg_trampoline(setg uintptr, g uintptr)68 // func setg_trampoline(setg uintptr, g uintptr)
65 TEXT ·setg_trampoline(SB), NOSPLIT, $0-1669 TEXT ·setg_trampoline(SB), NOSPLIT, $0-16
66 MOVQ G+8(FP), DI70 MOVQ G+8(FP), DI
M internal/fakecgo/trampolines_arm64.s +4 -0
@@ -41,6 +41,10 @@ TEXT x_cgo_notify_runtime_init_done_trampoline(SB), NOSPLIT, $0-0
4141 CALL ·x_cgo_notify_runtime_init_done(SB)
4242 RET
4343
44+TEXT x_cgo_bindm_trampoline(SB), NOSPLIT, $0
45+ CALL ·x_cgo_bindm(SB)
46+ RET
47+
4448 // func setg_trampoline(setg uintptr, g uintptr)
4549 TEXT ·setg_trampoline(SB), NOSPLIT, $0-16
4650 MOVD G+8(FP), R0
@@ -41,6 +41,10 @@ TEXT x_cgo_notify_runtime_init_done_trampoline(SB), NOSPLIT, $0-0
41 CALL ·x_cgo_notify_runtime_init_done(SB)41 CALL ·x_cgo_notify_runtime_init_done(SB)
42 RET42 RET
43 43
44+TEXT x_cgo_bindm_trampoline(SB), NOSPLIT, $0
45+ CALL ·x_cgo_bindm(SB)
46+ RET
47+
44 // func setg_trampoline(setg uintptr, g uintptr)48 // func setg_trampoline(setg uintptr, g uintptr)
45 TEXT ·setg_trampoline(SB), NOSPLIT, $0-1649 TEXT ·setg_trampoline(SB), NOSPLIT, $0-16
46 MOVD G+8(FP), R050 MOVD G+8(FP), R0
M internal/fakecgo/trampolines_stubs.s +32 -16
@@ -9,66 +9,82 @@
99
1010 // these stubs are here because it is not possible to go:linkname directly the C functions on darwin arm64
1111
12-TEXT _malloc(SB), NOSPLIT, $0-0
12+TEXT _malloc(SB), NOSPLIT|NOFRAME, $0-0
1313 JMP purego_malloc(SB)
1414 RET
1515
16-TEXT _free(SB), NOSPLIT, $0-0
16+TEXT _free(SB), NOSPLIT|NOFRAME, $0-0
1717 JMP purego_free(SB)
1818 RET
1919
20-TEXT _setenv(SB), NOSPLIT, $0-0
20+TEXT _setenv(SB), NOSPLIT|NOFRAME, $0-0
2121 JMP purego_setenv(SB)
2222 RET
2323
24-TEXT _unsetenv(SB), NOSPLIT, $0-0
24+TEXT _unsetenv(SB), NOSPLIT|NOFRAME, $0-0
2525 JMP purego_unsetenv(SB)
2626 RET
2727
28-TEXT _sigfillset(SB), NOSPLIT, $0-0
28+TEXT _sigfillset(SB), NOSPLIT|NOFRAME, $0-0
2929 JMP purego_sigfillset(SB)
3030 RET
3131
32-TEXT _nanosleep(SB), NOSPLIT, $0-0
32+TEXT _nanosleep(SB), NOSPLIT|NOFRAME, $0-0
3333 JMP purego_nanosleep(SB)
3434 RET
3535
36-TEXT _abort(SB), NOSPLIT, $0-0
36+TEXT _abort(SB), NOSPLIT|NOFRAME, $0-0
3737 JMP purego_abort(SB)
3838 RET
3939
40-TEXT _pthread_attr_init(SB), NOSPLIT, $0-0
40+TEXT _pthread_attr_init(SB), NOSPLIT|NOFRAME, $0-0
4141 JMP purego_pthread_attr_init(SB)
4242 RET
4343
44-TEXT _pthread_create(SB), NOSPLIT, $0-0
44+TEXT _pthread_create(SB), NOSPLIT|NOFRAME, $0-0
4545 JMP purego_pthread_create(SB)
4646 RET
4747
48-TEXT _pthread_detach(SB), NOSPLIT, $0-0
48+TEXT _pthread_detach(SB), NOSPLIT|NOFRAME, $0-0
4949 JMP purego_pthread_detach(SB)
5050 RET
5151
52-TEXT _pthread_sigmask(SB), NOSPLIT, $0-0
52+TEXT _pthread_sigmask(SB), NOSPLIT|NOFRAME, $0-0
5353 JMP purego_pthread_sigmask(SB)
5454 RET
5555
56-TEXT _pthread_self(SB), NOSPLIT, $0-0
56+TEXT _pthread_self(SB), NOSPLIT|NOFRAME, $0-0
5757 JMP purego_pthread_self(SB)
5858 RET
5959
60-TEXT _pthread_get_stacksize_np(SB), NOSPLIT, $0-0
60+TEXT _pthread_get_stacksize_np(SB), NOSPLIT|NOFRAME, $0-0
6161 JMP purego_pthread_get_stacksize_np(SB)
6262 RET
6363
64-TEXT _pthread_attr_getstacksize(SB), NOSPLIT, $0-0
64+TEXT _pthread_attr_getstacksize(SB), NOSPLIT|NOFRAME, $0-0
6565 JMP purego_pthread_attr_getstacksize(SB)
6666 RET
6767
68-TEXT _pthread_attr_setstacksize(SB), NOSPLIT, $0-0
68+TEXT _pthread_attr_setstacksize(SB), NOSPLIT|NOFRAME, $0-0
6969 JMP purego_pthread_attr_setstacksize(SB)
7070 RET
7171
72-TEXT _pthread_attr_destroy(SB), NOSPLIT, $0-0
72+TEXT _pthread_attr_destroy(SB), NOSPLIT|NOFRAME, $0-0
7373 JMP purego_pthread_attr_destroy(SB)
7474 RET
75+
76+TEXT _pthread_mutex_lock(SB), NOSPLIT|NOFRAME, $0-0
77+ JMP purego_pthread_mutex_lock(SB)
78+ RET
79+
80+TEXT _pthread_mutex_unlock(SB), NOSPLIT|NOFRAME, $0-0
81+ JMP purego_pthread_mutex_unlock(SB)
82+ RET
83+
84+TEXT _pthread_cond_broadcast(SB), NOSPLIT|NOFRAME, $0-0
85+ JMP purego_pthread_cond_broadcast(SB)
86+ RET
87+
88+TEXT _pthread_setspecific(SB), NOSPLIT|NOFRAME, $0-0
89+ JMP purego_pthread_setspecific(SB)
90+ RET
@@ -9,66 +9,82 @@
9 9
10 // these stubs are here because it is not possible to go:linkname directly the C functions on darwin arm6410 // these stubs are here because it is not possible to go:linkname directly the C functions on darwin arm64
11 11
12-TEXT _malloc(SB), NOSPLIT, $0-012+TEXT _malloc(SB), NOSPLIT|NOFRAME, $0-0
13 JMP purego_malloc(SB)13 JMP purego_malloc(SB)
14 RET14 RET
15 15
16-TEXT _free(SB), NOSPLIT, $0-016+TEXT _free(SB), NOSPLIT|NOFRAME, $0-0
17 JMP purego_free(SB)17 JMP purego_free(SB)
18 RET18 RET
19 19
20-TEXT _setenv(SB), NOSPLIT, $0-020+TEXT _setenv(SB), NOSPLIT|NOFRAME, $0-0
21 JMP purego_setenv(SB)21 JMP purego_setenv(SB)
22 RET22 RET
23 23
24-TEXT _unsetenv(SB), NOSPLIT, $0-024+TEXT _unsetenv(SB), NOSPLIT|NOFRAME, $0-0
25 JMP purego_unsetenv(SB)25 JMP purego_unsetenv(SB)
26 RET26 RET
27 27
28-TEXT _sigfillset(SB), NOSPLIT, $0-028+TEXT _sigfillset(SB), NOSPLIT|NOFRAME, $0-0
29 JMP purego_sigfillset(SB)29 JMP purego_sigfillset(SB)
30 RET30 RET
31 31
32-TEXT _nanosleep(SB), NOSPLIT, $0-032+TEXT _nanosleep(SB), NOSPLIT|NOFRAME, $0-0
33 JMP purego_nanosleep(SB)33 JMP purego_nanosleep(SB)
34 RET34 RET
35 35
36-TEXT _abort(SB), NOSPLIT, $0-036+TEXT _abort(SB), NOSPLIT|NOFRAME, $0-0
37 JMP purego_abort(SB)37 JMP purego_abort(SB)
38 RET38 RET
39 39
40-TEXT _pthread_attr_init(SB), NOSPLIT, $0-040+TEXT _pthread_attr_init(SB), NOSPLIT|NOFRAME, $0-0
41 JMP purego_pthread_attr_init(SB)41 JMP purego_pthread_attr_init(SB)
42 RET42 RET
43 43
44-TEXT _pthread_create(SB), NOSPLIT, $0-044+TEXT _pthread_create(SB), NOSPLIT|NOFRAME, $0-0
45 JMP purego_pthread_create(SB)45 JMP purego_pthread_create(SB)
46 RET46 RET
47 47
48-TEXT _pthread_detach(SB), NOSPLIT, $0-048+TEXT _pthread_detach(SB), NOSPLIT|NOFRAME, $0-0
49 JMP purego_pthread_detach(SB)49 JMP purego_pthread_detach(SB)
50 RET50 RET
51 51
52-TEXT _pthread_sigmask(SB), NOSPLIT, $0-052+TEXT _pthread_sigmask(SB), NOSPLIT|NOFRAME, $0-0
53 JMP purego_pthread_sigmask(SB)53 JMP purego_pthread_sigmask(SB)
54 RET54 RET
55 55
56-TEXT _pthread_self(SB), NOSPLIT, $0-056+TEXT _pthread_self(SB), NOSPLIT|NOFRAME, $0-0
57 JMP purego_pthread_self(SB)57 JMP purego_pthread_self(SB)
58 RET58 RET
59 59
60-TEXT _pthread_get_stacksize_np(SB), NOSPLIT, $0-060+TEXT _pthread_get_stacksize_np(SB), NOSPLIT|NOFRAME, $0-0
61 JMP purego_pthread_get_stacksize_np(SB)61 JMP purego_pthread_get_stacksize_np(SB)
62 RET62 RET
63 63
64-TEXT _pthread_attr_getstacksize(SB), NOSPLIT, $0-064+TEXT _pthread_attr_getstacksize(SB), NOSPLIT|NOFRAME, $0-0
65 JMP purego_pthread_attr_getstacksize(SB)65 JMP purego_pthread_attr_getstacksize(SB)
66 RET66 RET
67 67
68-TEXT _pthread_attr_setstacksize(SB), NOSPLIT, $0-068+TEXT _pthread_attr_setstacksize(SB), NOSPLIT|NOFRAME, $0-0
69 JMP purego_pthread_attr_setstacksize(SB)69 JMP purego_pthread_attr_setstacksize(SB)
70 RET70 RET
71 71
72-TEXT _pthread_attr_destroy(SB), NOSPLIT, $0-072+TEXT _pthread_attr_destroy(SB), NOSPLIT|NOFRAME, $0-0
73 JMP purego_pthread_attr_destroy(SB)73 JMP purego_pthread_attr_destroy(SB)
74 RET74 RET
75+
76+TEXT _pthread_mutex_lock(SB), NOSPLIT|NOFRAME, $0-0
77+ JMP purego_pthread_mutex_lock(SB)
78+ RET
79+
80+TEXT _pthread_mutex_unlock(SB), NOSPLIT|NOFRAME, $0-0
81+ JMP purego_pthread_mutex_unlock(SB)
82+ RET
83+
84+TEXT _pthread_cond_broadcast(SB), NOSPLIT|NOFRAME, $0-0
85+ JMP purego_pthread_cond_broadcast(SB)
86+ RET
87+
88+TEXT _pthread_setspecific(SB), NOSPLIT|NOFRAME, $0-0
89+ JMP purego_pthread_setspecific(SB)
90+ RET
M sys_amd64.s +2 -2
@@ -29,7 +29,7 @@
2929 // C calling convention (use libcCall).
3030 GLOBL ·syscall9XABI0(SB), NOPTR|RODATA, $8
3131 DATA ·syscall9XABI0(SB)/8, $syscall9X(SB)
32-TEXT syscall9X(SB), NOSPLIT, $0
32+TEXT syscall9X(SB), NOSPLIT|NOFRAME, $0
3333 PUSHQ BP
3434 MOVQ SP, BP
3535 SUBQ $32, SP
@@ -73,7 +73,7 @@ TEXT syscall9X(SB), NOSPLIT, $0
7373 POPQ BP
7474 RET
7575
76-TEXT callbackasm1(SB), NOSPLIT, $0
76+TEXT callbackasm1(SB), NOSPLIT|NOFRAME, $0
7777 // remove return address from stack, we are not returning to callbackasm, but to its caller.
7878 MOVQ 0(SP), AX
7979 ADDQ $8, SP
@@ -29,7 +29,7 @@
29 // C calling convention (use libcCall).29 // C calling convention (use libcCall).
30 GLOBL ·syscall9XABI0(SB), NOPTR|RODATA, $830 GLOBL ·syscall9XABI0(SB), NOPTR|RODATA, $8
31 DATA ·syscall9XABI0(SB)/8, $syscall9X(SB)31 DATA ·syscall9XABI0(SB)/8, $syscall9X(SB)
32-TEXT syscall9X(SB), NOSPLIT, $032+TEXT syscall9X(SB), NOSPLIT|NOFRAME, $0
33 PUSHQ BP33 PUSHQ BP
34 MOVQ SP, BP34 MOVQ SP, BP
35 SUBQ $32, SP35 SUBQ $32, SP
@@ -73,7 +73,7 @@ TEXT syscall9X(SB), NOSPLIT, $0
73 POPQ BP73 POPQ BP
74 RET74 RET
75 75
76-TEXT callbackasm1(SB), NOSPLIT, $076+TEXT callbackasm1(SB), NOSPLIT|NOFRAME, $0
77 // remove return address from stack, we are not returning to callbackasm, but to its caller.77 // remove return address from stack, we are not returning to callbackasm, but to its caller.
78 MOVQ 0(SP), AX78 MOVQ 0(SP), AX
79 ADDQ $8, SP79 ADDQ $8, SP
M syscall_sysv.go +5 -2
@@ -117,8 +117,11 @@ const ptrSize = unsafe.Sizeof((*int)(nil))
117117
118118 const callbackMaxFrame = 64 * ptrSize
119119
120-// callbackasmABI0 is implemented in zcallback_GOOS_GOARCH.s
121-var callbackasmABI0 uintptr
120+// callbackasm is implemented in zcallback_GOOS_GOARCH.s
121+//
122+//go:linkname __callbackasm callbackasm
123+var __callbackasm byte
124+var callbackasmABI0 = uintptr(unsafe.Pointer(&__callbackasm))
122125
123126 // callbackWrap_call allows the calling of the ABIInternal wrapper
124127 // which is required for runtime.cgocallback without the
@@ -117,8 +117,11 @@ const ptrSize = unsafe.Sizeof((*int)(nil))
117 117
118 const callbackMaxFrame = 64 * ptrSize118 const callbackMaxFrame = 64 * ptrSize
119 119
120-// callbackasmABI0 is implemented in zcallback_GOOS_GOARCH.s120+// callbackasm is implemented in zcallback_GOOS_GOARCH.s
121-var callbackasmABI0 uintptr121+//
122+//go:linkname __callbackasm callbackasm
123+var __callbackasm byte
124+var callbackasmABI0 = uintptr(unsafe.Pointer(&__callbackasm))
122 125
123 // callbackWrap_call allows the calling of the ABIInternal wrapper126 // callbackWrap_call allows the calling of the ABIInternal wrapper
124 // which is required for runtime.cgocallback without the127 // which is required for runtime.cgocallback without the
M zcallback_amd64.s +1 -3
@@ -11,9 +11,7 @@
1111 // which Go callback function is executed later on.
1212 #include "textflag.h"
1313
14-GLOBL ·callbackasmABI0(SB), NOPTR|RODATA, $8
15-DATA ·callbackasmABI0(SB)/8, $callbackasm(SB)
16-TEXT callbackasm(SB), 7, $0
14+TEXT callbackasm(SB), NOSPLIT|NOFRAME, $0
1715 CALL callbackasm1(SB)
1816 CALL callbackasm1(SB)
1917 CALL callbackasm1(SB)
@@ -11,9 +11,7 @@
11 // which Go callback function is executed later on.11 // which Go callback function is executed later on.
12 #include "textflag.h"12 #include "textflag.h"
13 13
14-GLOBL ·callbackasmABI0(SB), NOPTR|RODATA, $814+TEXT callbackasm(SB), NOSPLIT|NOFRAME, $0
15-DATA ·callbackasmABI0(SB)/8, $callbackasm(SB)
16-TEXT callbackasm(SB), 7, $0
17 CALL callbackasm1(SB)15 CALL callbackasm1(SB)
18 CALL callbackasm1(SB)16 CALL callbackasm1(SB)
19 CALL callbackasm1(SB)17 CALL callbackasm1(SB)
M zcallback_arm64.s +0 -2
@@ -11,8 +11,6 @@
1111 // It then calls the Go implementation for that callback.
1212 #include "textflag.h"
1313
14-GLOBL ·callbackasmABI0(SB), NOPTR|RODATA, $8
15-DATA ·callbackasmABI0(SB)/8, $callbackasm(SB)
1614 TEXT callbackasm(SB), NOSPLIT|NOFRAME, $0
1715 MOVD $0, R12
1816 B callbackasm1(SB)
@@ -11,8 +11,6 @@
11 // It then calls the Go implementation for that callback.11 // It then calls the Go implementation for that callback.
12 #include "textflag.h"12 #include "textflag.h"
13 13
14-GLOBL ·callbackasmABI0(SB), NOPTR|RODATA, $8
15-DATA ·callbackasmABI0(SB)/8, $callbackasm(SB)
16 TEXT callbackasm(SB), NOSPLIT|NOFRAME, $014 TEXT callbackasm(SB), NOSPLIT|NOFRAME, $0
17 MOVD $0, R1215 MOVD $0, R12
18 B callbackasm1(SB)16 B callbackasm1(SB)

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