Source file
src/runtime/export_windows_test.go
1
2
3
4
5
6
7 package runtime
8
9 import (
10 "internal/runtime/sys"
11 "unsafe"
12 )
13
14 var (
15 OsYield = osyield
16 TimeBeginPeriodRetValue = &timeBeginPeriodRetValue
17 )
18
19 func NumberOfProcessors() int32 {
20 var info systeminfo
21 stdcall(_GetSystemInfo, uintptr(unsafe.Pointer(&info)))
22 return int32(info.dwnumberofprocessors)
23 }
24
25 type ContextStub struct {
26 context
27 }
28
29 func (c ContextStub) GetPC() uintptr {
30 return c.ip()
31 }
32
33 func NewContextStub() *ContextStub {
34 var ctx context
35 ctx.set_ip(sys.GetCallerPC())
36 ctx.set_sp(sys.GetCallerSP())
37 ctx.set_fp(getcallerfp())
38 return &ContextStub{ctx}
39 }
40
View as plain text