Received: from eggs.gnu.org ([208.118.235.92]:34253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMkhF-0007wa-9m for qemu-devel@nongnu.org; Mon, 01 Apr 2013 15:47:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMkhE-0007ym-0T for qemu-devel@nongnu.org; Mon, 01 Apr 2013 15:47:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMkhD-0007yc-Pe for qemu-devel@nongnu.org; Mon, 01 Apr 2013 15:47:11 -0400 From: Eduardo Habkost Date: Mon, 1 Apr 2013 16:46:47 -0300 Message-Id: <1364845609-10543-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1364845609-10543-1-git-send-email-ehabkost@redhat.com> References: <1364845609-10543-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [RFC 2/4] target-i386: Move feature word array outside get_register_name_32() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: libvir-list@redhat.com, Igor Mammedov , Jiri Denemark , =?UTF-8?q?Andreas=20F=C3=A4rber?= The array will be used by the "feature-words" properties to output the register enum value. Signed-off-by: Eduardo Habkost --- 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