Source file
src/runtime/os_linux_arm.go
1
2
3
4
5 package runtime
6
7 import (
8 "internal/cpu"
9 "unsafe"
10 )
11
12 const (
13 _HWCAP_VFP = 1 << 6
14 _HWCAP_VFPv3 = 1 << 13
15 )
16
17 func vdsoCall()
18
19 func checkgoarm() {
20
21
22
23 if GOOS == "android" {
24 return
25 }
26 if cpu.HWCap&_HWCAP_VFP == 0 && goarmsoftfp == 0 {
27 print("runtime: this CPU has no floating point hardware, so it cannot run\n")
28 print("a binary compiled for hard floating point. Recompile adding ,softfloat\n")
29 print("to GOARM.\n")
30 exit(1)
31 }
32 if goarm > 6 && cpu.HWCap&_HWCAP_VFPv3 == 0 && goarmsoftfp == 0 {
33 print("runtime: this CPU has no VFPv3 floating point hardware, so it cannot run\n")
34 print("a binary compiled for VFPv3 hard floating point. Recompile adding ,softfloat\n")
35 print("to GOARM or changing GOARM to 6.\n")
36 exit(1)
37 }
38 }
39
40 func archauxv(tag, val uintptr) {
41 switch tag {
42 case _AT_HWCAP:
43 cpu.HWCap = uint(val)
44 case _AT_HWCAP2:
45 cpu.HWCap2 = uint(val)
46 case _AT_PLATFORM:
47 cpu.Platform = gostringnocopy((*byte)(unsafe.Pointer(val)))
48 }
49 }
50
51 func osArchInit() {}
52
53
54 func cputicks() int64 {
55
56 return nanotime()
57 }
58
View as plain text