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

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



On Mon, Apr 01, 2013 at 04:46:47PM -0300, Eduardo Habkost wrote:
> The array will be used by the "feature-words" properties to output the
> register enum value.

Oops, the patch subject line is wrong: it was supposed to say "Move
register name array".

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

-- 
Eduardo


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