qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [RFC ppc-next 39/39] target-ppc: Convert CPU


From: Andreas Färber
Subject: Re: [Qemu-ppc] [Qemu-devel] [RFC ppc-next 39/39] target-ppc: Convert CPU definitions
Date: Wed, 13 Feb 2013 17:19:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 12.02.2013 17:48, schrieb Andreas Färber:
> Am 12.02.2013 11:13, schrieb Andreas Färber:
>> Turn the array of model definitions into a set of self-registering QOM
>> types with their own class_init. Unique identifiers are obtained from
>> the combination of PVR, SVR and family identifiers; this requires all
>> alias #defines to be removed from the list. Possibly there are some more
>> left after this commit that are not currently being compiled.
>>
>> Prepares for introducing abstract intermediate CPU types for families.
>>
>> Keep the right-aligned macro line breaks within 78 chars to aid
>> three-way merges.
>>
>> Signed-off-by: Andreas Färber <address@hidden>
>> ---
>>  target-ppc/cpu-qom.h        |   17 ++++-
>>  target-ppc/cpu.h            |   20 ------
>>  target-ppc/translate_init.c |  152 
>> ++++++++++++++++++++-----------------------
>>  3 Dateien geändert, 85 Zeilen hinzugefügt(+), 104 Zeilen entfernt(-)
> [...]
>> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
>> index fd8bf00..93e38ba 100644
>> --- a/target-ppc/translate_init.c
>> +++ b/target-ppc/translate_init.c
> [...]
>> @@ -10316,20 +10317,7 @@ static const TypeInfo ppc_cpu_type_info = {
>>  
>>  static void ppc_cpu_register_types(void)
>>  {
>> -    int i;
>> -
>>      type_register_static(&ppc_cpu_type_info);
>> -
>> -    for (i = 0; i < ARRAY_SIZE(ppc_defs); i++) {
>> -        const ppc_def_t *def = &ppc_defs[i];
>> -#if defined(TARGET_PPCEMB)
>> -        /* When using the ppcemb target, we only support 440 style cores */
>> -        if (def->mmu_model != POWERPC_MMU_BOOKE) {
>> -            continue;
>> -        }
>> -#endif
>> -        ppc_cpu_register_model(def);
>> -    }
>>  }
>>  
>>  type_init(ppc_cpu_register_types)
> 
> Sorry, I forgot to re-add the TARGET_PPCEMB check above.

Here's the fix (sorry for linewraps):

@@ -7507,6 +7507,14 @@ enum {
 /* PowerPC CPU definitions
      */
 #define POWERPC_DEF_PREFIX(pvr, svr, type)
     \
     glue(glue(glue(glue(pvr, _), svr), _), type)
+#if defined(TARGET_PPCEMB)
+#define POWERPC_DEF_CONDITION(type)
     \
+    if (glue(POWERPC_MMU_, type) != POWERPC_MMU_BOOKE) {
     \
+        return;
     \
+    }
+#else
+#define POWERPC_DEF_CONDITION(type)
+#endif
 #define POWERPC_DEF_SVR(_name, _pvr, _svr, _type)
       \
     static void
     \
     glue(POWERPC_DEF_PREFIX(_pvr, _svr, _type), _cpu_class_init)
     \
@@ -7539,6 +7547,7 @@ enum {
     static void
     \
     glue(POWERPC_DEF_PREFIX(_pvr, _svr, _type),
_cpu_register_types)(void)  \
     {
     \
+        POWERPC_DEF_CONDITION(_type)
     \
         type_register_static(
     \
             &glue(POWERPC_DEF_PREFIX(_pvr, _svr, _type),
_cpu_type_info));  \
     }
     \

I'll repost when the family definitions are cleaned up.

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]