From e8b4c5bfe9405c573c63337b739a135c06edf7d9 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Thu, 12 Nov 2015 15:43:18 -0500 Subject: [PATCH] runtime, runtime/internal/sys: fix build for linux/{mips64,mips64le} Change-Id: I37bac9680efdfd797ca5dca90bd9a9e1001bfb68 Reviewed-on: https://go-review.googlesource.com/16874 Reviewed-by: Michael Matloob --- src/runtime/internal/sys/zgoarch_mips64.go | 26 ++++++++++++++++++++ src/runtime/internal/sys/zgoarch_mips64le.go | 26 ++++++++++++++++++++ src/runtime/signal_linux_mips64x.go | 7 ++++-- src/runtime/signal_mips64x.go | 7 ++++-- 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 src/runtime/internal/sys/zgoarch_mips64.go create mode 100644 src/runtime/internal/sys/zgoarch_mips64le.go diff --git a/src/runtime/internal/sys/zgoarch_mips64.go b/src/runtime/internal/sys/zgoarch_mips64.go new file mode 100644 index 0000000000..b4a97d6da9 --- /dev/null +++ b/src/runtime/internal/sys/zgoarch_mips64.go @@ -0,0 +1,26 @@ +// generated by gengoos.go using 'go generate' + +package sys + +const TheGoarch = `mips64` + +const Goarch386 = 0 +const GoarchAmd64 = 0 +const GoarchAmd64p32 = 0 +const GoarchArm = 0 +const GoarchArmbe = 0 +const GoarchArm64 = 0 +const GoarchArm64be = 0 +const GoarchPpc64 = 0 +const GoarchPpc64le = 0 +const GoarchMips = 0 +const GoarchMipsle = 0 +const GoarchMips64 = 1 +const GoarchMips64le = 0 +const GoarchMips64p32 = 0 +const GoarchMips64p32le = 0 +const GoarchPpc = 0 +const GoarchS390 = 0 +const GoarchS390x = 0 +const GoarchSparc = 0 +const GoarchSparc64 = 0 diff --git a/src/runtime/internal/sys/zgoarch_mips64le.go b/src/runtime/internal/sys/zgoarch_mips64le.go new file mode 100644 index 0000000000..3328a35bd2 --- /dev/null +++ b/src/runtime/internal/sys/zgoarch_mips64le.go @@ -0,0 +1,26 @@ +// generated by gengoos.go using 'go generate' + +package sys + +const TheGoarch = `mips64le` + +const Goarch386 = 0 +const GoarchAmd64 = 0 +const GoarchAmd64p32 = 0 +const GoarchArm = 0 +const GoarchArmbe = 0 +const GoarchArm64 = 0 +const GoarchArm64be = 0 +const GoarchPpc64 = 0 +const GoarchPpc64le = 0 +const GoarchMips = 0 +const GoarchMipsle = 0 +const GoarchMips64 = 0 +const GoarchMips64le = 1 +const GoarchMips64p32 = 0 +const GoarchMips64p32le = 0 +const GoarchPpc = 0 +const GoarchS390 = 0 +const GoarchS390x = 0 +const GoarchSparc = 0 +const GoarchSparc64 = 0 diff --git a/src/runtime/signal_linux_mips64x.go b/src/runtime/signal_linux_mips64x.go index c550f69908..671b9167b8 100644 --- a/src/runtime/signal_linux_mips64x.go +++ b/src/runtime/signal_linux_mips64x.go @@ -7,7 +7,10 @@ package runtime -import "unsafe" +import ( + "runtime/internal/sys" + "unsafe" +) type sigctxt struct { info *siginfo @@ -63,5 +66,5 @@ func (c *sigctxt) set_link(x uint64) { c.regs().sc_regs[31] = x } func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) } func (c *sigctxt) set_sigaddr(x uint64) { - *(*uintptr)(add(unsafe.Pointer(c.info), 2*ptrSize)) = uintptr(x) + *(*uintptr)(add(unsafe.Pointer(c.info), 2*sys.PtrSize)) = uintptr(x) } diff --git a/src/runtime/signal_mips64x.go b/src/runtime/signal_mips64x.go index 81ce59594a..51598e8e5a 100644 --- a/src/runtime/signal_mips64x.go +++ b/src/runtime/signal_mips64x.go @@ -7,7 +7,10 @@ package runtime -import "unsafe" +import ( + "runtime/internal/sys" + "unsafe" +) func dumpregs(c *sigctxt) { print("r0 ", hex(c.r0()), "\t") @@ -80,7 +83,7 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) { // functions are correctly handled. This smashes // the stack frame but we're not going back there // anyway. - sp := c.sp() - ptrSize + sp := c.sp() - sys.PtrSize c.set_sp(sp) *(*uint64)(unsafe.Pointer(uintptr(sp))) = c.link() -- 2.48.1