runtime: use syscall for cputicks on Fuchsia
Change-Id: If2d513651cec8361dd2c96c50b8f9408e5b9e809
diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s
index a422ace..7adc9ab 100644
--- a/src/runtime/asm_amd64.s
+++ b/src/runtime/asm_amd64.s
@@ -853,6 +853,7 @@
CALL runtime·abort(SB)
RET
+#ifndef GOOS_fuchsia
// func cputicks() int64
TEXT runtime·cputicks(SB),NOSPLIT,$0-0
CMPB runtime·lfenceBeforeRdtsc(SB), $1
@@ -867,6 +868,7 @@
ADDQ DX, AX
MOVQ AX, ret+0(FP)
RET
+#endif
// func aeshash(p unsafe.Pointer, h, s uintptr) uintptr
// hash function using AES hardware instructions
diff --git a/src/runtime/cputicks.go b/src/runtime/cputicks.go
index 7beb57e..e58d4c7 100644
--- a/src/runtime/cputicks.go
+++ b/src/runtime/cputicks.go
@@ -9,6 +9,7 @@
// +build !mips
// +build !mipsle
// +build !wasm
+// +build !fuchsia
package runtime
diff --git a/src/runtime/os_fuchsia.go b/src/runtime/os_fuchsia.go
index 36fa57d..a640020 100644
--- a/src/runtime/os_fuchsia.go
+++ b/src/runtime/os_fuchsia.go
@@ -10,6 +10,11 @@
"unsafe"
)
+//go:nosplit
+func cputicks() int64 {
+ return int64(zx.Sys_ticks_get())
+}
+
type mOS struct{}
type sigset struct{}
diff --git a/src/runtime/os_fuchsia_arm64.go b/src/runtime/os_fuchsia_arm64.go
index 143fe39..e5b021a 100644
--- a/src/runtime/os_fuchsia_arm64.go
+++ b/src/runtime/os_fuchsia_arm64.go
@@ -3,10 +3,3 @@
// license that can be found in the LICENSE file.
package runtime
-
-import "syscall/zx"
-
-//go:nosplit
-func cputicks() int64 {
- return int64(zx.Sys_ticks_get())
-}