github.com/razvanm/vanadium-go-1.3@v0.0.0-20160721203343-4a65068e5915/src/runtime/os_netbsd_amd64.c (about) 1 // Copyright 2009 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 9 void 10 runtime·lwp_mcontext_init(McontextT *mc, void *stack, M *mp, G *gp, void (*fn)(void)) 11 { 12 // Machine dependent mcontext initialisation for LWP. 13 mc->__gregs[REG_RIP] = (uint64)runtime·lwp_tramp; 14 mc->__gregs[REG_RSP] = (uint64)stack; 15 mc->__gregs[REG_R8] = (uint64)mp; 16 mc->__gregs[REG_R9] = (uint64)gp; 17 mc->__gregs[REG_R12] = (uint64)fn; 18 }