The array will be used by the "feature-words" properties to output the
register enum value.
Signed-off-by: Eduardo Habkost <ehabkost(a)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