qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: libvir-list@redhat.com, "Igor Mammedov" <imammedo@redhat.com>,
	"Jiri Denemark" <jdenemar@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [RFC 2/4] target-i386: Move feature word array outside get_register_name_32()
Date: Mon,  1 Apr 2013 16:46:47 -0300	[thread overview]
Message-ID: <1364845609-10543-3-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1364845609-10543-1-git-send-email-ehabkost@redhat.com>

The array will be used by the "feature-words" properties to output the
register enum value.

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

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 974a8c6..2020147 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -194,23 +194,24 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
     },
 };
 
+static const char *reg_names_32[CPU_NB_REGS32] = {
+    [R_EAX] = "EAX",
+    [R_ECX] = "ECX",
+    [R_EDX] = "EDX",
+    [R_EBX] = "EBX",
+    [R_ESP] = "ESP",
+    [R_EBP] = "EBP",
+    [R_ESI] = "ESI",
+    [R_EDI] = "EDI",
+};
+
+
 const char *get_register_name_32(unsigned int reg)
 {
-    static const char *reg_names[CPU_NB_REGS32] = {
-        [R_EAX] = "EAX",
-        [R_ECX] = "ECX",
-        [R_EDX] = "EDX",
-        [R_EBX] = "EBX",
-        [R_ESP] = "ESP",
-        [R_EBP] = "EBP",
-        [R_ESI] = "ESI",
-        [R_EDI] = "EDI",
-    };
-
     if (reg > CPU_NB_REGS32) {
         return NULL;
     }
-    return reg_names[reg];
+    return reg_names_32[reg];
 }
 
 /* collects per-function cpuid data
-- 
1.8.1.4

  parent reply	other threads:[~2013-04-01 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 19:46 [Qemu-devel] [RFC 0/4] target-i386: Add "feature-words" CPU object property Eduardo Habkost
2013-04-01 19:46 ` [Qemu-devel] [RFC 1/4] target-i386: Add ECX information to FeatureWordInfo Eduardo Habkost
2013-04-01 19:46 ` Eduardo Habkost [this message]
2013-04-02 18:54   ` [Qemu-devel] [RFC 2/4] target-i386: Move feature word array outside get_register_name_32() Eduardo Habkost
2013-04-01 19:46 ` [Qemu-devel] [RFC 3/4] target-i386: Add "feature-words" property Eduardo Habkost
2013-04-01 19:46 ` [Qemu-devel] [RFC 4/4] target-i386: Use qapi for x86_cpu_get_feature_words() 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=1364845609-10543-3-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --cc=imammedo@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=libvir-list@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).