[RFC 2/4] target-i386: Move feature word array outside get_register_name_32()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]