qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC v3 08/21] target-arm: Move CPU feature flags


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH RFC v3 08/21] target-arm: Move CPU feature flags out of CPUState
Date: Tue, 07 Feb 2012 18:43:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0

Am 07.02.2012 18:28, schrieb Peter Maydell:
> On 3 February 2012 02:59, Andreas Färber <address@hidden> wrote:
>> +static void sa11xx_class_init(ARMCPUClass *k, const ARMCPUInfo *info)
>> +{
>> +    set_class_feature(k, ARM_FEATURE_STRONGARM);
>> +}
> 
>>  static const ARMCPUInfo arm_cpus[] = {
>>     {
>>         .name = "arm926",
>>         .id = 0x41069265,
>> +        .features = ARM_FEATURE(V5) |
>> +                    ARM_FEATURE(VFP),
>>     },
> 
>>     {
>>         .name = "sa1100",
>>         .id = 0x4401A11B,
>> +        .class_init = sa11xx_class_init,
>>     },
> 
> So why are we handling some of these feature bits by setting them
> in .features, and some of them via a .class_init which sets the
> feature bit?

To avoid duplication. This corresponds to fall-throughs in the switch.

Eventually as suggested by you we would get rid of some of these
duplicate models and let the user (or an alias-like compatibility
mechanism) set the desired revision numbers on one base class via QOM
properties. Then those class_inits would no longer be needed.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]