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

Re: [Xen-devel] [PATCH 1/6] xen/x86: Add a helper to calculate family/model/stepping information



>>> On 16.11.16 at 13:31, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -183,6 +183,25 @@ int get_cpu_vendor(const char v[], enum get_cpu_vendor 
> mode)
>       return X86_VENDOR_UNKNOWN;
>  }
>  
> +u8 get_cpu_family(uint32_t raw, u8 *model, u8 *stepping)
> +{
> +     u8 fam, mod;
> +
> +     fam = (raw >> 8) & 0xf;
> +     if (fam == 0xf)
> +             fam += (raw >> 20) & 0xff;
> +
> +     mod = (raw >> 4) & 0xf;
> +     if (fam >= 0x6)
> +             mod |= (raw >> 12) & 0xf0;
> +
> +     if ( model )
> +             *model = mod;
> +     if ( stepping )
> +             *stepping = raw & 0xf;

With these converted to Linux style
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

But then I think it would be nice if we could slowly get rid of u8 and
alike, in favor of the standard uint8_t and friends, so I would
appreciate if you could avoid introducing new instances.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.