1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 16:27:05 +00:00
node-feature-discovery/pkg/cpuid/cpuid_amd64.go
Markus Lehtonen 86382afe56 Re-factor cpuid functionality out of source/rdt
Move the cpuid functionality into a separate library package so that it
can be easily re-used by other sources.
2019-04-12 14:36:08 +03:00

29 lines
826 B
Go

/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cpuid
type CpuidRet struct {
EAX, EBX, ECX, EDX uint32
}
func Cpuid(eax, ecx uint32) *CpuidRet {
r := &CpuidRet{}
r.EAX, r.EBX, r.ECX, r.EDX = cpuidAsm(eax, ecx)
return r
}
func cpuidAsm(eax_arg, ecx_arg uint32) (eax, ebx, ecx, edx uint32)