Am 07.02.2012 18:28, schrieb Peter Maydell:
> On 3 February 2012 02:59, Andreas Färber <afaer...@suse.de> 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