]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add missing code for linux/riscv64
authorJoel Sing <joel@sing.id.au>
Wed, 22 Jan 2020 16:42:07 +0000 (03:42 +1100)
committerJoel Sing <joel@sing.id.au>
Thu, 23 Jan 2020 14:36:57 +0000 (14:36 +0000)
Makes linux/riscv64 runtime buildable.

Updates #27532

Change-Id: I91bcadaaecb8ff3ffd70fcb437b2b6e4bbe11eda
Reviewed-on: https://go-review.googlesource.com/c/go/+/215839
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/mkpreempt.go
src/runtime/mpagealloc_64bit.go
src/runtime/os_linux_riscv64.go [new file with mode: 0644]
src/runtime/preempt_riscv64.s [new file with mode: 0644]

index 615ec1868ca2ea79ddee95fe26dd12efb3a30234..64e220772e1ba2b229a40f10a478616c2b17ef6a 100644 (file)
@@ -83,6 +83,7 @@ var arches = map[string]func(){
        "mips64x": func() { genMIPS(true) },
        "mipsx":   func() { genMIPS(false) },
        "ppc64x":  genPPC64,
+       "riscv64": genRISCV64,
        "s390x":   genS390X,
        "wasm":    genWasm,
 }
@@ -478,6 +479,11 @@ func genPPC64() {
        p("JMP (CTR)")
 }
 
+func genRISCV64() {
+       p("// No async preemption on riscv64 - see issue 36711")
+       p("UNDEF")
+}
+
 func genS390X() {
        // Add integer registers R0-R12
        // R13 (g), R14 (LR), R15 (SP) are special, and not saved here.
index 86883bef35f4fcf52d1ff0c40a5f95b0cdf4dbec..0b475ed206d34586155101751ddbb9de70254a05 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build amd64 !darwin,arm64 mips64 mips64le ppc64 ppc64le s390x
+// +build amd64 !darwin,arm64 mips64 mips64le ppc64 ppc64le riscv64 s390x
 
 // See mpagealloc_32bit.go for why darwin/arm64 is excluded here.
 
diff --git a/src/runtime/os_linux_riscv64.go b/src/runtime/os_linux_riscv64.go
new file mode 100644 (file)
index 0000000..9be88a5
--- /dev/null
@@ -0,0 +1,7 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package runtime
+
+func osArchInit() {}
diff --git a/src/runtime/preempt_riscv64.s b/src/runtime/preempt_riscv64.s
new file mode 100644 (file)
index 0000000..80c0636
--- /dev/null
@@ -0,0 +1,8 @@
+// Code generated by mkpreempt.go; DO NOT EDIT.
+
+#include "go_asm.h"
+#include "textflag.h"
+
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
+       // No async preemption on riscv64 - see issue 36711
+       UNDEF