Patchwork [RFC,11/19] rename x86_def_t to X86CPUDefinition

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

Comments

Eduardo Habkost - Aug. 3, 2012, 2:59 a.m.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index c96300e..4f67ecc 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -222,8 +222,8 @@  static void add_flagname_to_bitmaps(const char *flagname, uint32_t *features,
             fprintf(stderr, "CPU feature %s not found\n", flagname);
 }
 
-typedef struct x86_def_t {
-    struct x86_def_t *next;
+typedef struct X86CPUDefinition {
+    struct X86CPUDefinition *next;
     const char *name;
     uint32_t level;
     uint32_t vendor1, vendor2, vendor3;
@@ -242,7 +242,7 @@  typedef struct x86_def_t {
     uint32_t xlevel2;
     /* The feature bits on CPUID[EAX=7,ECX=0].EBX */
     uint32_t cpuid_7_0_ebx_features;
-} x86_def_t;
+} X86CPUDefinition;
 
 #define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE)
 #define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \
@@ -284,11 +284,11 @@  typedef struct x86_def_t {
 
 /* maintains list of cpu model definitions
  */
-static x86_def_t *x86_defs = {NULL};
+static X86CPUDefinition *x86_defs = {NULL};
 
 /* built-in cpu model definitions (deprecated)
  */
-static x86_def_t builtin_x86_defs[] = {
+static X86CPUDefinition builtin_x86_defs[] = {
     {
         .name = "qemu64",
         .level = 4,
@@ -722,7 +722,7 @@  static int cpu_x86_fill_model_id(char *str)
     return 0;
 }
 
-static int cpu_x86_fill_host(x86_def_t *x86_cpu_def)
+static int cpu_x86_fill_host(X86CPUDefinition *x86_cpu_def)
 {
     uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
 
@@ -798,9 +798,9 @@  static int unavailable_host_feature(struct model_features_t *f, uint32_t mask)
  * their way to the guest.  Note: ft[].check_feat ideally should be
  * specified via a guest_def field to suppress report of extraneous flags.
  */
-static int check_features_against_host(x86_def_t *guest_def)
+static int check_features_against_host(X86CPUDefinition *guest_def)
 {
-    x86_def_t host_def;
+    X86CPUDefinition host_def;
     uint32_t mask;
     int rv, i;
     struct model_features_t ft[] = {
@@ -1077,11 +1077,12 @@  static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *v, void *opaque,
     cpu->env.tsc_khz = value / 1000;
 }
 
-/* Extend a x86_def_t struct based on a +feature,-feature,feature=xyz string
+/* Extend a X86CPUDefinition based on a +feature,-feature,feature=xyz string
  *
  * Returns 0 on success, -1 on error.
  */
-static int cpu_x86_extend_features(x86_def_t *x86_cpu_def, char *featlist)
+static int cpu_x86_extend_features(X86CPUDefinition *x86_cpu_def,
+                                   char *featlist)
 {
     unsigned int i;
     char *last, *featurestr;
@@ -1231,9 +1232,9 @@  error:
     return -1;
 }
 
-static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name)
+static int cpu_x86_find_by_name(X86CPUDefinition *x86_cpu_def, const char *name)
 {
-    x86_def_t *def;
+    X86CPUDefinition *def;
 
     for (def = x86_defs; def; def = def->next) {
         if (name && !strcmp(name, def->name)) {
@@ -1253,7 +1254,7 @@  error:
     return -1;
 }
 
-static int cpu_x86_build_from_name(x86_def_t *x86_cpu_def,
+static int cpu_x86_build_from_name(X86CPUDefinition *x86_cpu_def,
                                    const char *cpu_model)
 {
     char *last;
@@ -1315,7 +1316,7 @@  static void listflags(char *buf, int bufsize, uint32_t fbits,
 /* generate CPU information:
  * -?        list model names
  * -?model   list model names/IDs
- * -?dump    output all model (x86_def_t) data
+ * -?dump    output all model (X86CPUDefinition) data
  * -?cpuid   list all recognized cpuid flag names
  */
 void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
@@ -1323,7 +1324,7 @@  void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
     unsigned char model = !strcmp("?model", optarg);
     unsigned char dump = !strcmp("?dump", optarg);
     unsigned char cpuid = !strcmp("?cpuid", optarg);
-    x86_def_t *def;
+    X86CPUDefinition *def;
     char buf[256];
 
     if (cpuid) {
@@ -1381,7 +1382,7 @@  void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
 int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
 {
     CPUX86State *env = &cpu->env;
-    x86_def_t def1, *def = &def1;
+    X86CPUDefinition def1, *def = &def1;
     Error *error = NULL;
 
     memset(def, 0, sizeof(*def));
@@ -1500,11 +1501,11 @@  static void setfeatures(uint32_t *pval, const char *str,
     }
 }
 
-/* map config file options to x86_def_t form
+/* map config file options to X86CPUDefinition form
  */
 static int cpudef_setfield(const char *name, const char *str, void *opaque)
 {
-    x86_def_t *def = opaque;
+    X86CPUDefinition *def = opaque;
     int err = 0;
 
     if (!strcmp(name, "name")) {
@@ -1545,11 +1546,11 @@  static int cpudef_setfield(const char *name, const char *str, void *opaque)
     return (0);
 }
 
-/* register config file entry as x86_def_t
+/* register config file entry as X86CPUDefinition
  */
 static int cpudef_register(QemuOpts *opts, void *opaque)
 {
-    x86_def_t *def = g_malloc0(sizeof(x86_def_t));
+    X86CPUDefinition *def = g_malloc0(sizeof(X86CPUDefinition));
 
     qemu_opt_foreach(opts, cpudef_setfield, def, 1);
     def->next = x86_defs;
@@ -1573,7 +1574,7 @@  void x86_cpudef_setup(void)
     static const char *model_with_versions[] = { "qemu32", "qemu64", "athlon" };
 
     for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
-        x86_def_t *def = &builtin_x86_defs[i];
+        X86CPUDefinition *def = &builtin_x86_defs[i];
         def->next = x86_defs;
         def->is_builtin = true;