diff options
author | Vladimir Stefanovic <vladimir.stefanovic@imgtec.com> | 2016-12-13 21:56:58 +0100 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-12-14 23:52:33 +0000 |
commit | b909d011520700149b72d556837f68069d2d372a (patch) | |
tree | a8ba15095ca31f73b66bdc96c948cc266022c81f /src/runtime/cgocall.go | |
parent | a3b670e3333ca0f677a82321d3ad173e01e973a5 (diff) | |
download | go-b909d011520700149b72d556837f68069d2d372a.tar.gz go-b909d011520700149b72d556837f68069d2d372a.zip |
runtime: add cgo support for GOARCH=mips{,le}
Change-Id: Ib425ead7b340672837d3cb983bd785488706bd6d
Reviewed-on: https://go-review.googlesource.com/34314
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/cgocall.go')
-rw-r--r-- | src/runtime/cgocall.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index 007406b426..69e29ef976 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -286,6 +286,10 @@ func cgocallbackg1(ctxt uintptr) { // On mips64x, stack frame is two words and there's a saved LR between // SP and the stack frame and between the stack frame and the arguments. cb = (*args)(unsafe.Pointer(sp + 4*sys.PtrSize)) + case "mips", "mipsle": + // On mipsx, stack frame is two words and there's a saved LR between + // SP and the stack frame and between the stack frame and the arguments. + cb = (*args)(unsafe.Pointer(sp + 4*sys.PtrSize)) } // Invoke callback. @@ -323,7 +327,7 @@ func unwindm(restore *bool) { switch GOARCH { default: throw("unwindm not implemented") - case "386", "amd64", "arm", "ppc64", "ppc64le", "mips64", "mips64le", "s390x": + case "386", "amd64", "arm", "ppc64", "ppc64le", "mips64", "mips64le", "s390x", "mips", "mipsle": sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + sys.MinFrameSize)) case "arm64": sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + 16)) |