| 1 |
// Code generated by 'go generate'; DO NOT EDIT. |
| 2 |
|
| 3 |
package cpu |
| 4 |
|
| 5 |
import ( |
| 6 |
"syscall" |
| 7 |
"unsafe" |
| 8 |
) |
| 9 |
|
| 10 |
var _ unsafe.Pointer |
| 11 |
|
| 12 |
// Do the interface allocations only once for common |
| 13 |
// Errno values. |
| 14 |
const ( |
| 15 |
errnoERROR_IO_PENDING = 997 |
| 16 |
) |
| 17 |
|
| 18 |
var ( |
| 19 |
errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) |
| 20 |
errERROR_EINVAL error = syscall.EINVAL |
| 21 |
) |
| 22 |
|
| 23 |
// errnoErr returns common boxed Errno values, to prevent |
| 24 |
// allocations at runtime. |
| 25 |
func errnoErr(e syscall.Errno) error { |
| 26 |
switch e { |
| 27 |
case 0: |
| 28 |
return errERROR_EINVAL |
| 29 |
case errnoERROR_IO_PENDING: |
| 30 |
return errERROR_IO_PENDING |
| 31 |
} |
| 32 |
// TODO: add more here, after collecting data on the common |
| 33 |
// error values see on Windows. (perhaps when running |
| 34 |
// all.bat?) |
| 35 |
return e |
| 36 |
} |
| 37 |
|
| 38 |
var ( |
| 39 |
modkernel32 = syscall.NewLazyDLL("kernel32.dll") |
| 40 |
|
| 41 |
procIsProcessorFeaturePresent = modkernel32.NewProc("IsProcessorFeaturePresent") |
| 42 |
) |
| 43 |
|
| 44 |
func isProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) { |
| 45 |
r0, _, _ := syscall.SyscallN(procIsProcessorFeaturePresent.Addr(), uintptr(ProcessorFeature)) |
| 46 |
ret = r0 != 0 |
| 47 |
return |
| 48 |
} |