qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Igor Mammedov" <imammedo@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [RFC 11/19] rename x86_def_t to X86CPUDefinition
Date: Thu,  2 Aug 2012 23:59:18 -0300	[thread overview]
Message-ID: <1343962766-22024-12-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1343962766-22024-1-git-send-email-ehabkost@redhat.com>

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

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;
 
-- 
1.7.11.2

  parent reply	other threads:[~2012-08-03  3:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  2:59 [Qemu-devel] [RFC 00/19] i386 CPU code cleanup + CPU model classes Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 01/19] target-i386/cpu.c: coding style fixes Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 02/19] x86_cpudef_setup: coding style change Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 03/19] i386: x86_def_t: rename 'flags' field Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 04/19] rename cpu_x86_find_by_name to x86_cpu_build_from_name Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 05/19] cpu_x86_build_from_name: use strtok_r() Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 06/19] i386: cpu: extract the full feature list before parsing it Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 07/19] i386: cpu: extract parsing of feature strings to separate function Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 08/19] i386: extract CPU model lookup to a " Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 09/19] i386: reorder object setup on cpu_x86_init() Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 10/19] move CPU object creation to cpu.c Eduardo Habkost
2012-08-03  2:59 ` Eduardo Habkost [this message]
2012-08-03  2:59 ` [Qemu-devel] [RFC 12/19] create struct X86CPUModelTableEntry Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 13/19] move X86CPUDefinition to cpu-qom.h Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 14/19] extract CPU object field initialization from cpu_x86_register() Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 15/19] cpu_x86_create: move error handling to end of function Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 16/19] kill cpu_x86_register() Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 17/19] kill cpu_x86_build_from_name() Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 18/19] register a class for each CPU model Eduardo Habkost
2012-08-03  2:59 ` [Qemu-devel] [RFC 19/19] HACK: late CPU class initialization Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343962766-22024-12-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).