diff options
author | Cherry Zhang <lunaria21@gmail.com> | 2016-04-27 22:18:24 -0400 |
---|---|---|
committer | Minux Ma <minux@golang.org> | 2016-05-04 16:41:10 +0000 |
commit | b6687c8933e2e123cd336d6ee96aa43df40bfc24 (patch) | |
tree | 162f8e8544b853d50b10cc02281f0a2d7b9d9506 /src/runtime/cgocall.go | |
parent | 6e9043234221678e53d3b46ea98fb2ed56c260b7 (diff) | |
download | go-git-b6687c8933e2e123cd336d6ee96aa43df40bfc24.tar.gz |
runtime: add linux/mips64x cgo support
Change-Id: Id40dd05b7b264f3b779fdf9ccc2421ba4bc70589
Reviewed-on: https://go-review.googlesource.com/19806
Reviewed-by: Minux Ma <minux@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 6dceff09ef..8457fb2de7 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -286,6 +286,10 @@ func cgocallbackg1(ctxt uintptr) { // | | fixed frame area | // +--------------------+------------------------------+ <- sp cb = (*args)(unsafe.Pointer(sp + 2*sys.MinFrameSize + 2*sys.PtrSize)) + case "mips64", "mips64le": + // 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)) } // Invoke callback. @@ -323,7 +327,7 @@ func unwindm(restore *bool) { switch GOARCH { default: throw("unwindm not implemented") - case "386", "amd64", "arm", "ppc64", "ppc64le", "s390x": + case "386", "amd64", "arm", "ppc64", "ppc64le", "mips64", "mips64le", "s390x": sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + sys.MinFrameSize)) case "arm64": sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + 16)) |