@@ -102,6 +102,7 @@ struct SysemuCPUOps;
* CPUClass:
* @class_by_name: Callback to map -cpu command line model name to an
* instantiatable CPU type.
+ * @list_cpus: list available CPU models and flags.
* @parse_features: Callback to parse command line arguments.
* @reset_dump_flags: #CPUDumpFlags to use for reset logging.
* @mmu_index: Callback for choosing softmmu mmu index;
@@ -150,6 +151,7 @@ struct CPUClass {
/*< public >*/
ObjectClass *(*class_by_name)(const char *cpu_model);
+ void (*list_cpus)(void);
void (*parse_features)(const char *typename, char *str, Error **errp);
int (*mmu_index)(CPUState *cpu, bool ifetch);
@@ -98,7 +98,13 @@ static void cpu_list(void)
void list_cpus(void)
{
- cpu_list();
+ CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE));
+
+ if (cc->list_cpus) {
+ cc->list_cpus();
+ } else {
+ cpu_list();
+ }
}
/* enable or disable single step mode. EXCP_DEBUG is returned by the