blob: 1ccc9592da8647c0856aba3f622a893138ee8be6 [file] [log] [blame]
Shenghou Ma56e8f8e2014-12-26 01:07:10 -05001// Copyright 2014 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package runtime
6
7func checkgoarm() {
Russ Cox4a190812015-08-07 11:48:52 -04008 // TODO(minux): FP checks like in os_linux_arm.go.
9
10 // osinit not called yet, so ncpu not set: must use getncpu directly.
11 if getncpu() > 1 && goarm < 7 {
12 print("runtime: this system has multiple CPUs and must use\n")
13 print("atomic synchronization instructions. Recompile using GOARM=7.\n")
14 exit(1)
15 }
Shenghou Ma56e8f8e2014-12-26 01:07:10 -050016}
17
18//go:nosplit
19func cputicks() int64 {
20 // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
21 // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
22 // TODO: need more entropy to better seed fastrand1.
23 return nanotime()
24}