diff options
author | Dave Jones <davej@redhat.com> | 2009-12-10 21:27:44 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-12-10 21:27:44 -0500 |
commit | 375d469eeb15fbcfd831f7b66a0715f42a91a451 (patch) | |
tree | d4cfee51c5ab11bd908d30b0de38c9afdef16723 /cpuid.c | |
parent | a8af3758826f545b289a40ecefa627de1e5e9e90 (diff) |
Intel CPU topology reworking.
This steals lots of code from the kernel, and munges it to work with userspace.
In doing so, I renamed a bunch of x86info's struct cpudata members to match
the kernels struct cpu_data, just to make it easier to sync any future changes.
Diffstat (limited to 'cpuid.c')
-rw-r--r-- | cpuid.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -195,3 +195,21 @@ void cpuid4(unsigned int CPU_number, unsigned long long idx, { cpuid(CPU_number, 4 | (idx << 32), eax, ebx, ecx, edx); } + +/* Some CPUID calls want 'count' to be placed in ecx */ +void cpuid_count(struct cpudata *cpu, unsigned int op, int count, + unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) +{ + *ecx = count; + cpuid(cpu->number, op, eax, ebx, ecx, edx); +} + +unsigned int cpuid_ebx(struct cpudata *cpu, unsigned int op) +{ + unsigned int eax, ebx, ecx, edx; + + cpuid(cpu->number, op, &eax, &ebx, &ecx, &edx); + + return ebx; +} |