github.com/xushiwei/go@v0.0.0-20130601165731-2b9d83f45bc9/src/pkg/runtime/os_netbsd_arm.c (about) 1 // 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 5 #include "runtime.h" 6 #include "defs_GOOS_GOARCH.h" 7 #include "os_GOOS.h" 8 #include "signal_GOOS_GOARCH.h" 9 10 void 11 runtime·lwp_mcontext_init(McontextT *mc, void *stack, M *mp, G *gp, void (*fn)(void)) 12 { 13 mc->__gregs[REG_R15] = (uint32)runtime·lwp_tramp; 14 mc->__gregs[REG_R13] = (uint32)stack; 15 mc->__gregs[REG_R0] = (uint32)mp; 16 mc->__gregs[REG_R1] = (uint32)gp; 17 mc->__gregs[REG_R2] = (uint32)fn; 18 } 19 20 void 21 runtime·checkgoarm(void) 22 { 23 // TODO(minux) 24 } 25 26 #pragma textflag 7 27 int64 28 runtime·cputicks() { 29 // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1(). 30 // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler. 31 // TODO: need more entropy to better seed fastrand1. 32 return runtime·nanotime(); 33 }