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// Export guts for testing. 6 7package runtime 8 9import "unsafe" 10 11const MaxArgs = maxArgs 12 13var ( 14 OsYield = osyield 15 TimeBeginPeriodRetValue = &timeBeginPeriodRetValue 16) 17 18func NumberOfProcessors() int32 { 19 var info systeminfo 20 stdcall1(_GetSystemInfo, uintptr(unsafe.Pointer(&info))) 21 return int32(info.dwnumberofprocessors) 22} 23 24type ContextStub struct { 25 context 26} 27 28func (c ContextStub) GetPC() uintptr { 29 return c.ip() 30} 31 32func NewContextStub() *ContextStub { 33 var ctx context 34 ctx.set_ip(getcallerpc()) 35 ctx.set_sp(getcallersp()) 36 ctx.set_fp(getcallerfp()) 37 return &ContextStub{ctx} 38} 39