Shenghou Ma | 56e8f8e | 2014-12-26 01:07:10 -0500 | [diff] [blame] | 1 | // 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 | |
| 5 | package runtime |
| 6 | |
| 7 | func checkgoarm() { |
Russ Cox | 4a19081 | 2015-08-07 11:48:52 -0400 | [diff] [blame] | 8 | // 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 Ma | 56e8f8e | 2014-12-26 01:07:10 -0500 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | //go:nosplit |
| 19 | func 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 | } |