qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 7/7] target-ppc: add implementation of query-cpudefs


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 7/7] target-ppc: add implementation of query-cpudefs
Date: Fri, 27 Jul 2012 08:37:19 -0500

Signed-off-by: Anthony Liguori <address@hidden>
---
 target-ppc/translate_init.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 5742229..7e025cb 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -10345,6 +10345,31 @@ void ppc_cpu_list (FILE *f, fprintf_function 
cpu_fprintf)
     }
 }
 
+CpuDefInfoList *qmp_query_cpudefs(Error **errp)
+{
+    CpuDefInfoList *cpu_list = NULL;
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(ppc_defs); i++) {
+        CpuDefInfoList *entry;
+        CpuDefInfo *info;
+
+        if (!ppc_cpu_usable(&ppc_defs[i])) {
+            continue;
+        }
+
+        info = g_malloc0(sizeof(*info));
+        info->name = g_strdup(pcc_defs[i].name);
+
+        entry = g_malloc0(sizeof(*entry));
+        entry->value = info;
+        entry->next = cpu_list;
+        cpu_list = entry;
+    }
+
+    return cpu_list;
+}
+
 /* CPUClass::reset() */
 static void ppc_cpu_reset(CPUState *s)
 {
-- 
1.7.5.4




reply via email to

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