blob: 83c4c06cf93597661e6ae6b5e39521282343463d [file] [log] [blame]
Russ Cox7d516072014-12-05 16:17:09 -05001// Copyright 2013 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
7import "unsafe"
8
9func lwp_mcontext_init(mc *mcontextt, stk unsafe.Pointer, mp *m, gp *g, fn uintptr) {
10 // Machine dependent mcontext initialisation for LWP.
11 mc.__gregs[_REG_R15] = uint32(funcPC(lwp_tramp))
12 mc.__gregs[_REG_R13] = uint32(uintptr(stk))
13 mc.__gregs[_REG_R0] = uint32(uintptr(unsafe.Pointer(mp)))
14 mc.__gregs[_REG_R1] = uint32(uintptr(unsafe.Pointer(gp)))
15 mc.__gregs[_REG_R2] = uint32(fn)
16}
17
18func checkgoarm() {
19 // TODO(minux)
20}
21
22//go:nosplit
23func cputicks() int64 {
24 // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
25 // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
26 // TODO: need more entropy to better seed fastrand1.
27 return nanotime()
28}