Skip to content

Commit

Permalink
runtime, runtime/internal/sys: fix build for linux/{mips64,mips64le}
Browse files Browse the repository at this point in the history
Change-Id: I37bac9680efdfd797ca5dca90bd9a9e1001bfb68
Reviewed-on: https://go-review.googlesource.com/16874
Reviewed-by: Michael Matloob <[email protected]>
  • Loading branch information
minux committed Nov 12, 2015
1 parent 7c38ae0 commit e8b4c5b
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 4 deletions.
26 changes: 26 additions & 0 deletions src/runtime/internal/sys/zgoarch_mips64.go
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions src/runtime/internal/sys/zgoarch_mips64le.go
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions src/runtime/signal_linux_mips64x.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

package runtime

import "unsafe"
import (
"runtime/internal/sys"
"unsafe"
)

type sigctxt struct {
info *siginfo
Expand Down Expand Up @@ -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)
}
7 changes: 5 additions & 2 deletions src/runtime/signal_mips64x.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

package runtime

import "unsafe"
import (
"runtime/internal/sys"
"unsafe"
)

func dumpregs(c *sigctxt) {
print("r0 ", hex(c.r0()), "\t")
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit e8b4c5b

Please sign in to comment.