Patchwork [RFC,13/19] move X86CPUDefinition to cpu-qom.h

login
register
mail settings
Submitter Eduardo Habkost
Date Aug. 3, 2012, 2:59 a.m.
Message ID <1343962766-22024-14-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/174854/
State New
Headers show

Comments

Eduardo Habkost - Aug. 3, 2012, 2:59 a.m.
From: Eduardo Habkost <ehabkost@thinair.local>

The struct will be used by X86CPUClass, too.

Signed-off-by: Eduardo Habkost <ehabkost@thinair.local>
---
 target-i386/cpu-qom.h | 20 ++++++++++++++++++++
 target-i386/cpu.c     | 19 -------------------
 2 files changed, 20 insertions(+), 19 deletions(-)

Patch

diff --git a/target-i386/cpu-qom.h b/target-i386/cpu-qom.h
index 5901140..03e2c3a 100644
--- a/target-i386/cpu-qom.h
+++ b/target-i386/cpu-qom.h
@@ -37,6 +37,26 @@ 
 #define X86_CPU_GET_CLASS(obj) \
     OBJECT_GET_CLASS(X86CPUClass, (obj), TYPE_X86_CPU)
 
+
+typedef struct X86CPUDefinition {
+    uint32_t level;
+    uint32_t vendor1, vendor2, vendor3;
+    int family;
+    int model;
+    int stepping;
+    int tsc_khz;
+    uint32_t features, ext_features, ext2_features, ext3_features;
+    uint32_t kvm_features, svm_features;
+    uint32_t xlevel;
+    char model_id[48];
+    int vendor_override;
+    /* Store the results of Centaur's CPUID instructions */
+    uint32_t ext4_features;
+    uint32_t xlevel2;
+    /* The feature bits on CPUID[EAX=7,ECX=0].EBX */
+    uint32_t cpuid_7_0_ebx_features;
+} X86CPUDefinition;
+
 /**
  * X86CPUClass:
  * @parent_reset: The parent class' reset handler.
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 3f6efdb..5efbe41 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -222,25 +222,6 @@  static void add_flagname_to_bitmaps(const char *flagname, uint32_t *features,
             fprintf(stderr, "CPU feature %s not found\n", flagname);
 }
 
-typedef struct X86CPUDefinition {
-    uint32_t level;
-    uint32_t vendor1, vendor2, vendor3;
-    int family;
-    int model;
-    int stepping;
-    int tsc_khz;
-    uint32_t features, ext_features, ext2_features, ext3_features;
-    uint32_t kvm_features, svm_features;
-    uint32_t xlevel;
-    char model_id[48];
-    int vendor_override;
-    /* Store the results of Centaur's CPUID instructions */
-    uint32_t ext4_features;
-    uint32_t xlevel2;
-    /* The feature bits on CPUID[EAX=7,ECX=0].EBX */
-    uint32_t cpuid_7_0_ebx_features;
-} X86CPUDefinition;
-
 #define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE)
 #define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \
           CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_MMX | CPUID_APIC)