summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2011-02-22 19:26:58 -0500
committerDave Jones <davej@redhat.com>2011-02-22 19:26:58 -0500
commit560d98b10bf8155a3724ef2c0745b613cd26ce5e (patch)
tree971d563106374a6d3951c9a9963a458fa7e99404
parent5cd155a02560f8d253b429a77cb03416c2607825 (diff)
move dump_raw_cpuid into cpuid.c
-rw-r--r--Makefile1
-rw-r--r--cpuid.c14
-rw-r--r--dumpregs.c21
-rw-r--r--x86info.c6
-rw-r--r--x86info.h2
5 files changed, 18 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index fc367ac..d54ee42 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,6 @@ X86INFO_SRC =\
commandline.c\
havecpuid.c\
cpuid.c\
- dumpregs.c\
features.c\
identify.c\
rdmsr.c\
diff --git a/cpuid.c b/cpuid.c
index a5a2ad9..b772621 100644
--- a/cpuid.c
+++ b/cpuid.c
@@ -232,3 +232,17 @@ unsigned int cpuid_ebx(unsigned int CPU_number, unsigned int op)
return ebx;
}
+
+
+void dump_raw_cpuid(int cpunum, unsigned int begin, unsigned int end)
+{
+ unsigned int i;
+ unsigned int eax, ebx, ecx, edx;
+
+ /* Dump all the CPUID results in raw hex */
+ for (i = begin; i <= end; i++) {
+ cpuid(cpunum, i, &eax, &ebx, &ecx, &edx);
+ printf("eax in: 0x%08x, eax = %08x ebx = %08x ecx = %08x edx = %08x\n", i, eax, ebx, ecx, edx);
+ }
+ printf("\n");
+}
diff --git a/dumpregs.c b/dumpregs.c
deleted file mode 100644
index 0585506..0000000
--- a/dumpregs.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * (C) 2001,2008 Dave Jones.
- *
- * Licensed under the terms of the GNU GPL License version 2.
- */
-
-#include <stdio.h>
-#include "x86info.h"
-
-void dumpregs(int cpunum, unsigned int begin, unsigned int end)
-{
- unsigned int i;
- unsigned int eax, ebx, ecx, edx;
-
- /* Dump all the CPUID results in raw hex */
- for (i = begin; i <= end; i++) {
- cpuid(cpunum, i, &eax, &ebx, &ecx, &edx);
- printf("eax in: 0x%08x, eax = %08x ebx = %08x ecx = %08x edx = %08x\n", i, eax, ebx, ecx, edx);
- }
- printf("\n");
-}
diff --git a/x86info.c b/x86info.c
index 77df0c7..f87f824 100644
--- a/x86info.c
+++ b/x86info.c
@@ -38,12 +38,12 @@ static void display_detailed_info(struct cpudata *cpu)
show_info(cpu);
if (show_cpuid) {
- dumpregs(cpu->number, 0, cpu->cpuid_level);
+ dump_raw_cpuid(cpu->number, 0, cpu->cpuid_level);
if (cpu->maxei >=0x80000000)
- dumpregs (cpu->number, 0x80000000, cpu->maxei);
+ dump_raw_cpuid(cpu->number, 0x80000000, cpu->maxei);
if (cpu->maxei2 >=0xC0000000)
- dumpregs (cpu->number, 0xC0000000, cpu->maxei2);
+ dump_raw_cpuid(cpu->number, 0xC0000000, cpu->maxei2);
}
if (show_cacheinfo) {
diff --git a/x86info.h b/x86info.h
index 56be0c6..dcc74f5 100644
--- a/x86info.h
+++ b/x86info.h
@@ -157,7 +157,7 @@ void binary32(unsigned long value);
void binary64(unsigned long long value);
void dumpmsr(int cpunum, unsigned int msr, int size);
void dumpmsr_bin(int cpunum, unsigned int msr, int size);
-void dumpregs(int cpunum, unsigned int begin, unsigned int end);
+void dump_raw_cpuid(int cpunum, unsigned int begin, unsigned int end);
void dump_mtrrs(struct cpudata *cpu);
void dump_apics(struct cpudata *cpu);