Skip to content

Commit d5dc36a

Browse files
4a6f656cgopherbot
authored andcommitted
runtime: remove openbsd/mips64 related code
The openbsd/mips64 port has been broken for many years and it has not been possible to land the changes needed to unbreak it. As such, this port is considered dead and can be decommissioned in order to remove technical debt and allow other changes to be completed. Updates #61546 Change-Id: I9680eab9fb3aa85b83de47c66e9ebaf8c388a3bd Reviewed-on: https://go-review.googlesource.com/c/go/+/649659 Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Keith Randall <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Mark Freeman <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 64ba724 commit d5dc36a

18 files changed

+493
-1411
lines changed

src/runtime/crash_unix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestCrashDumpsAllThreads(t *testing.T) {
6565
t.Skipf("skipping; not supported on %v", runtime.GOOS)
6666
}
6767

68-
if runtime.GOOS == "openbsd" && (runtime.GOARCH == "arm" || runtime.GOARCH == "mips64" || runtime.GOARCH == "ppc64") {
68+
if runtime.GOOS == "openbsd" && (runtime.GOARCH == "arm" || runtime.GOARCH == "ppc64") {
6969
// This may be ncpu < 2 related...
7070
t.Skipf("skipping; test fails on %s/%s - see issue #42464", runtime.GOOS, runtime.GOARCH)
7171
}

src/runtime/defs_openbsd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ GOARCH=amd64 go tool cgo -godefs defs_openbsd.go
1111
GOARCH=386 go tool cgo -godefs defs_openbsd.go
1212
GOARCH=arm go tool cgo -godefs defs_openbsd.go
1313
GOARCH=arm64 go tool cgo -godefs defs_openbsd.go
14-
GOARCH=mips64 go tool cgo -godefs defs_openbsd.go
1514
*/
1615

1716
package runtime

src/runtime/defs_openbsd_mips64.go

Lines changed: 0 additions & 171 deletions
This file was deleted.

src/runtime/os_openbsd.go

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,54 @@ func semawakeup(mp *m) {
134134
}
135135
}
136136

137+
// mstart_stub provides glue code to call mstart from pthread_create.
138+
func mstart_stub()
139+
140+
// May run with m.p==nil, so write barriers are not allowed.
141+
//
142+
//go:nowritebarrierrec
143+
func newosproc(mp *m) {
144+
if false {
145+
print("newosproc m=", mp, " g=", mp.g0, " id=", mp.id, " ostk=", &mp, "\n")
146+
}
147+
148+
// Initialize an attribute object.
149+
var attr pthreadattr
150+
if err := pthread_attr_init(&attr); err != 0 {
151+
writeErrStr(failthreadcreate)
152+
exit(1)
153+
}
154+
155+
// Find out OS stack size for our own stack guard.
156+
var stacksize uintptr
157+
if pthread_attr_getstacksize(&attr, &stacksize) != 0 {
158+
writeErrStr(failthreadcreate)
159+
exit(1)
160+
}
161+
mp.g0.stack.hi = stacksize // for mstart
162+
163+
// Tell the pthread library we won't join with this thread.
164+
if pthread_attr_setdetachstate(&attr, _PTHREAD_CREATE_DETACHED) != 0 {
165+
writeErrStr(failthreadcreate)
166+
exit(1)
167+
}
168+
169+
// Finally, create the thread. It starts at mstart_stub, which does some low-level
170+
// setup and then calls mstart.
171+
var oset sigset
172+
sigprocmask(_SIG_SETMASK, &sigset_all, &oset)
173+
err := retryOnEAGAIN(func() int32 {
174+
return pthread_create(&attr, abi.FuncPCABI0(mstart_stub), unsafe.Pointer(mp))
175+
})
176+
sigprocmask(_SIG_SETMASK, &oset, nil)
177+
if err != 0 {
178+
writeErrStr(failthreadcreate)
179+
exit(1)
180+
}
181+
182+
pthread_attr_destroy(&attr)
183+
}
184+
137185
func osinit() {
138186
numCPUStartup = getCPUCount()
139187
physPageSize = getPageSize()
@@ -160,9 +208,6 @@ func goenvs() {
160208
// Called on the parent thread (main thread in case of bootstrap), can allocate memory.
161209
func mpreinit(mp *m) {
162210
gsignalSize := int32(32 * 1024)
163-
if GOARCH == "mips64" {
164-
gsignalSize = int32(64 * 1024)
165-
}
166211
mp.gsignal = malg(gsignalSize)
167212
mp.gsignal.m = mp
168213
}

src/runtime/os_openbsd_libc.go

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/runtime/os_openbsd_mips64.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/runtime/os_openbsd_syscall.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/runtime/os_openbsd_syscall1.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)