aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os_linux_arm.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/os_linux_arm.go')
-rw-r--r--src/runtime/os_linux_arm.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/runtime/os_linux_arm.go b/src/runtime/os_linux_arm.go
index 14f1cfeaef..8f082ba6a0 100644
--- a/src/runtime/os_linux_arm.go
+++ b/src/runtime/os_linux_arm.go
@@ -4,20 +4,20 @@
package runtime
-import "unsafe"
+import (
+ "internal/cpu"
+ "unsafe"
+)
const (
_AT_PLATFORM = 15 // introduced in at least 2.6.11
_HWCAP_VFP = 1 << 6 // introduced in at least 2.6.11
_HWCAP_VFPv3 = 1 << 13 // introduced in 2.6.30
- _HWCAP_IDIVA = 1 << 17
)
var randomNumber uint32
var armArch uint8 = 6 // we default to ARMv6
-var hwcap uint32 // set by archauxv
-var hardDiv bool // set if a hardware divider is available
func checkgoarm() {
// On Android, /proc/self/auxv might be unreadable and hwcap won't
@@ -26,12 +26,12 @@ func checkgoarm() {
if GOOS == "android" {
return
}
- if goarm > 5 && hwcap&_HWCAP_VFP == 0 {
+ if goarm > 5 && cpu.HWCap&_HWCAP_VFP == 0 {
print("runtime: this CPU has no floating point hardware, so it cannot run\n")
print("this GOARM=", goarm, " binary. Recompile using GOARM=5.\n")
exit(1)
}
- if goarm > 6 && hwcap&_HWCAP_VFPv3 == 0 {
+ if goarm > 6 && cpu.HWCap&_HWCAP_VFPv3 == 0 {
print("runtime: this CPU has no VFPv3 floating point hardware, so it cannot run\n")
print("this GOARM=", goarm, " binary. Recompile using GOARM=5 or GOARM=6.\n")
exit(1)
@@ -53,9 +53,10 @@ func archauxv(tag, val uintptr) {
armArch = t - '0'
}
- case _AT_HWCAP: // CPU capability bit flags
- hwcap = uint32(val)
- hardDiv = (hwcap & _HWCAP_IDIVA) != 0
+ case _AT_HWCAP:
+ cpu.HWCap = uint(val)
+ case _AT_HWCAP2:
+ cpu.HWCap2 = uint(val)
}
}