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.
5 // Export guts for testing.
11 const MaxArgs = maxArgs
15 TimeBeginPeriodRetValue = &timeBeginPeriodRetValue
18 func NumberOfProcessors() int32 {
20 stdcall1(_GetSystemInfo, uintptr(unsafe.Pointer(&info)))
21 return int32(info.dwnumberofprocessors)
24 type ContextStub struct {
28 func (c ContextStub) GetPC() uintptr {
32 func NewContextStub() *ContextStub {
34 ctx.set_ip(getcallerpc())
35 ctx.set_sp(getcallersp())
37 // getfp is not implemented on windows/386 and windows/arm,
38 // in which case it returns 0.
40 ctx.set_fp(*(*uintptr)(unsafe.Pointer(fp)))
42 return &ContextStub{ctx}