|
@@ -171,15 +171,12 @@ TEXT runtime·{{ .Libname }}(SB),NOSPLIT,$0
|
|
|
}
|
|
|
|
|
|
case "syscallfiles":
|
|
|
+ var tmpl *template.Template
|
|
|
+ var err error
|
|
|
a := os.Getenv("ARCH")
|
|
|
switch a {
|
|
|
case "amd64":
|
|
|
- case "riscv":
|
|
|
- usage("riscv support is incomplete")
|
|
|
- default:
|
|
|
- usage(a + " is not supported.")
|
|
|
- }
|
|
|
- tmpl, err := template.New("syscall.s").Parse(`/* automatically generated by mksys */
|
|
|
+ tmpl, err = template.New("syscall.s").Parse(`/* automatically generated by mksys */
|
|
|
.globl {{ .Libname }}
|
|
|
{{ .Libname }}:
|
|
|
movq %rcx, %r10 /* rcx gets smashed by systenter. Use r10.*/
|
|
@@ -190,6 +187,20 @@ TEXT runtime·{{ .Libname }}(SB),NOSPLIT,$0
|
|
|
if err != nil {
|
|
|
log.Fatal(err)
|
|
|
}
|
|
|
+ case "riscv":
|
|
|
+ tmpl, err = template.New("syscall.s").Parse(`/* automatically generated by mksys */
|
|
|
+.globl {{ .Libname }}
|
|
|
+{{ .Libname }}:
|
|
|
+ /*movq ${{ .Id }},%rax * Put the system call into rax, just like linux. */
|
|
|
+ scall
|
|
|
+ ret
|
|
|
+`)
|
|
|
+ if err != nil {
|
|
|
+ log.Fatal(err)
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ usage(a + " is not supported for system call generation.")
|
|
|
+ }
|
|
|
|
|
|
for i := range syscalls {
|
|
|
|