Source file src/runtime/export_windows_test.go

     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  
     7  package runtime
     8  
     9  import "unsafe"
    10  
    11  const MaxArgs = maxArgs
    12  
    13  var (
    14  	OsYield                 = osyield
    15  	TimeBeginPeriodRetValue = &timeBeginPeriodRetValue
    16  )
    17  
    18  func NumberOfProcessors() int32 {
    19  	var info systeminfo
    20  	stdcall1(_GetSystemInfo, uintptr(unsafe.Pointer(&info)))
    21  	return int32(info.dwnumberofprocessors)
    22  }
    23  
    24  type ContextStub struct {
    25  	context
    26  }
    27  
    28  func (c ContextStub) GetPC() uintptr {
    29  	return c.ip()
    30  }
    31  
    32  func 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  

View as plain text