Commit 0f08dd21 authored by Michael Munday's avatar Michael Munday Committed by Minux Ma

runtime: add s390x support (modified files only)

Change-Id: Ib79ad4a890994ad64edb1feb79bd242d26b5b08a
Reviewed-on: https://go-review.googlesource.com/20945Reviewed-by: default avatarMinux Ma <minux@golang.org>
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent a2eded34
...@@ -246,8 +246,8 @@ func cgocallbackg1() { ...@@ -246,8 +246,8 @@ func cgocallbackg1() {
case "386": case "386":
// On 386, stack frame is three words, plus caller PC. // On 386, stack frame is three words, plus caller PC.
cb = (*args)(unsafe.Pointer(sp + 4*sys.PtrSize)) cb = (*args)(unsafe.Pointer(sp + 4*sys.PtrSize))
case "ppc64", "ppc64le": case "ppc64", "ppc64le", "s390x":
// On ppc64, the callback arguments are in the arguments area of // On ppc64 and s390x, the callback arguments are in the arguments area of
// cgocallback's stack frame. The stack looks like this: // cgocallback's stack frame. The stack looks like this:
// +--------------------+------------------------------+ // +--------------------+------------------------------+
// | | ... | // | | ... |
...@@ -300,7 +300,7 @@ func unwindm(restore *bool) { ...@@ -300,7 +300,7 @@ func unwindm(restore *bool) {
switch GOARCH { switch GOARCH {
default: default:
throw("unwindm not implemented") throw("unwindm not implemented")
case "386", "amd64", "arm", "ppc64", "ppc64le": case "386", "amd64", "arm", "ppc64", "ppc64le", "s390x":
sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + sys.MinFrameSize)) sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + sys.MinFrameSize))
case "arm64": case "arm64":
sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + 16)) sched.sp = *(*uintptr)(unsafe.Pointer(sched.sp + 16))
......
...@@ -227,5 +227,5 @@ func Version() string { ...@@ -227,5 +227,5 @@ func Version() string {
const GOOS string = sys.TheGoos const GOOS string = sys.TheGoos
// GOARCH is the running program's architecture target: // GOARCH is the running program's architecture target:
// 386, amd64, or arm. // 386, amd64, arm, or s390x.
const GOARCH string = sys.TheGoarch const GOARCH string = sys.TheGoarch
...@@ -144,7 +144,7 @@ func infoBigStruct() []byte { ...@@ -144,7 +144,7 @@ func infoBigStruct() []byte {
typeScalar, typeScalar, typeScalar, typeScalar, // t int; y uint16; u uint64 typeScalar, typeScalar, typeScalar, typeScalar, // t int; y uint16; u uint64
typePointer, typeScalar, // i string typePointer, typeScalar, // i string
} }
case "arm64", "amd64", "mips64", "mips64le", "ppc64", "ppc64le": case "arm64", "amd64", "mips64", "mips64le", "ppc64", "ppc64le", "s390x":
return []byte{ return []byte{
typePointer, // q *int typePointer, // q *int
typeScalar, typeScalar, typeScalar, // w byte; e [17]byte typeScalar, typeScalar, typeScalar, // w byte; e [17]byte
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// xxhash: https://code.google.com/p/xxhash/ // xxhash: https://code.google.com/p/xxhash/
// cityhash: https://code.google.com/p/cityhash/ // cityhash: https://code.google.com/p/cityhash/
// +build amd64 amd64p32 arm64 mips64 mips64le ppc64 ppc64le // +build amd64 amd64p32 arm64 mips64 mips64le ppc64 ppc64le s390x
package runtime package runtime
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Routines that are implemented in assembly in asm_{amd64,386,arm,arm64,ppc64x}.s // Routines that are implemented in assembly in asm_{amd64,386,arm,arm64,ppc64x,s390x}.s
// +build mips64 mips64le // +build mips64 mips64le
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
// +build !mips64 // +build !mips64
// +build !mips64le // +build !mips64le
// +build !s390x
// +build linux // +build linux
package runtime package runtime
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
// +build !mips64 // +build !mips64
// +build !mips64le // +build !mips64le
// +build !s390x
// +build linux // +build linux
package runtime package runtime
......
...@@ -104,7 +104,7 @@ func TestGdbPython(t *testing.T) { ...@@ -104,7 +104,7 @@ func TestGdbPython(t *testing.T) {
// stack frames on RISC architectures. // stack frames on RISC architectures.
canBackTrace := false canBackTrace := false
switch runtime.GOARCH { switch runtime.GOARCH {
case "amd64", "386", "ppc64", "ppc64le", "arm", "arm64", "mips64", "mips64le": case "amd64", "386", "ppc64", "ppc64le", "arm", "arm64", "mips64", "mips64le", "s390x":
canBackTrace = true canBackTrace = true
args = append(args, args = append(args,
"-ex", "echo BEGIN goroutine 2 bt\n", "-ex", "echo BEGIN goroutine 2 bt\n",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build 386 amd64 amd64p32 arm64 ppc64 ppc64le // +build 386 amd64 amd64p32 arm64 ppc64 ppc64le s390x
package runtime package runtime
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment