aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/cgocall.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-01-27 01:06:52 -0500
committerRuss Cox <rsc@golang.org>2021-02-19 00:01:38 +0000
commit8ac23a1f151a9b1842797652ed7761f397055b5b (patch)
treec3948d0a51feb71a12a7696df67cff07ae30e3b8 /src/runtime/cgocall.go
parent678568a5cfe1806c16bf478234d6dac283c3474d (diff)
downloadgo-8ac23a1f151a9b1842797652ed7761f397055b5b.tar.gz
go-8ac23a1f151a9b1842797652ed7761f397055b5b.zip
runtime: document, clean up internal/sys
Document what the values in internal/sys mean. Remove various special cases for arm64 in the code using StackAlign. Delete Uintreg - it was for GOARCH=amd64p32, which was specific to GOOS=nacl and has been retired. This CL is part of a stack adding windows/arm64 support (#36439), intended to land in the Go 1.17 cycle. This CL is, however, not windows/arm64-specific. It is cleanup meant to make the port (and future ports) easier. Change-Id: I40e8fa07b4e192298b6536b98a72a751951a4383 Reviewed-on: https://go-review.googlesource.com/c/go/+/288795 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/cgocall.go')
-rw-r--r--src/runtime/cgocall.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go
index 20cacd6043..534a2c4295 100644
--- a/src/runtime/cgocall.go
+++ b/src/runtime/cgocall.go
@@ -306,14 +306,7 @@ func unwindm(restore *bool) {
// unwind of g's stack (see comment at top of file).
mp := acquirem()
sched := &mp.g0.sched
- switch GOARCH {
- default:
- throw("unwindm not implemented")
- case "386", "amd64", "arm", "ppc64", "ppc64le", "mips64", "mips64le", "s390x", "mips", "mipsle", "riscv64":
- sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + sys.MinFrameSize))
- case "arm64":
- sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + 16))
- }
+ sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + alignUp(sys.MinFrameSize, sys.StackAlign)))
// Do the accounting that cgocall will not have a chance to do
// during an unwind.