Source file
src/runtime/os_freebsd_arm.go
1
2
3
4
5 package runtime
6
7 import "internal/cpu"
8
9 const (
10 _HWCAP_VFP = 1 << 6
11 _HWCAP_VFPv3 = 1 << 13
12 )
13
14 func checkgoarm() {
15 if goarm > 5 && cpu.HWCap&_HWCAP_VFP == 0 {
16 print("runtime: this CPU has no floating point hardware, so it cannot run\n")
17 print("this GOARM=", goarm, " binary. Recompile using GOARM=5.\n")
18 exit(1)
19 }
20 if goarm > 6 && cpu.HWCap&_HWCAP_VFPv3 == 0 {
21 print("runtime: this CPU has no VFPv3 floating point hardware, so it cannot run\n")
22 print("this GOARM=", goarm, " binary. Recompile using GOARM=5 or GOARM=6.\n")
23 exit(1)
24 }
25
26
27 if getncpu() > 1 && goarm < 7 {
28 print("runtime: this system has multiple CPUs and must use\n")
29 print("atomic synchronization instructions. Recompile using GOARM=7.\n")
30 exit(1)
31 }
32 }
33
34 func archauxv(tag, val uintptr) {
35 switch tag {
36 case _AT_HWCAP:
37 cpu.HWCap = uint(val)
38 case _AT_HWCAP2:
39 cpu.HWCap2 = uint(val)
40 }
41 }
42
43
44 func cputicks() int64 {
45
46
47 return nanotime()
48 }
49
View as plain text